You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Run nix with given args, interpreting stdout as JSON, parsing into `T`
90
92
pubasyncfnrun_with_args_expecting_json<T>(
91
93
&self,
92
-
msubcommand:Option<&str>,
94
+
subcommands:&[&str],
93
95
args:&[&str],
94
96
) -> Result<T,NixCmdError>
95
97
where
96
98
T: serde::de::DeserializeOwned,
97
99
{
98
100
let stdout:Vec<u8> = self
99
-
.run_with_returning_stdout(msubcommand, |c| {
101
+
.run_with_returning_stdout(subcommands, |c| {
100
102
c.args(args);
101
103
})
102
104
.await?;
@@ -107,15 +109,15 @@ impl NixCmd {
107
109
/// Run nix with given args, interpreting parsing stdout, via [std::str::FromStr], into `T`
108
110
pubasyncfnrun_with_args_expecting_fromstr<T>(
109
111
&self,
110
-
msubcommand:Option<&str>,
112
+
subcommands:&[&str],
111
113
args:&[&str],
112
114
) -> Result<T,NixCmdError>
113
115
where
114
116
T: std::str::FromStr,
115
117
<Tas std::str::FromStr>::Err: std::fmt::Display,
116
118
{
117
119
let stdout = self
118
-
.run_with_returning_stdout(msubcommand, |c| {
120
+
.run_with_returning_stdout(subcommands, |c| {
119
121
c.args(args);
120
122
})
121
123
.await?;
@@ -127,13 +129,13 @@ impl NixCmd {
127
129
/// Like [Self::run_with] but returns stdout as a [`Vec<u8>`]
128
130
pubasyncfnrun_with_returning_stdout<F>(
129
131
&self,
130
-
msubcommand:Option<&str>,
132
+
subcommands:&[&str],
131
133
f:F,
132
134
) -> Result<Vec<u8>,CommandError>
133
135
where
134
136
F:FnOnce(&mutCommand),
135
137
{
136
-
letmut cmd = self.command(msubcommand);
138
+
letmut cmd = self.command(subcommands);
137
139
f(&mut cmd);
138
140
trace_cmd(&cmd);
139
141
@@ -156,15 +158,11 @@ impl NixCmd {
156
158
/// Run Nix with given [Command] customizations, while also tracing the command being run.
157
159
///
158
160
/// Return the stdout bytes returned by [tokio::process::Child::wait_with_output]. In order to capture stdout, you must call `cmd.stdout(Stdio::piped());` inside the handler.
0 commit comments