-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Hi,
Would it be possible to allow using self.field in cmd! macros ?
For example, this would allow to use a struct to store common args of commands.
struct Commons {
sh: Shell,
field: String,
}
impl Commons {
fn execute(&self) {
let command = cmd!(self.sh, "echo {self.field}");
command.run();
}
}I have not attempted to make the change, so that i don't know if it would be possible.
If the self. is removed from the above code, the compiler hints at something that would work.
error[E0425]: cannot find value `field` in this scope
--> src/main.rs:88:13
|
88 | / "
89 | | echo {field}
90 | | "
| |_____________^ help: you might have meant to use the available field: `self.field`
lnicola and domwst
Metadata
Metadata
Assignees
Labels
No labels