MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / wrap

Method wrap

src/executor/helpers/command.rs:84–107  ·  view source on GitHub ↗
(&mut self, wrapper: S, wrapper_args: I)

Source from the content-addressed store, hash-verified

82 }
83
84 pub fn wrap<S, I, T>(&mut self, wrapper: S, wrapper_args: I) -> &mut Self
85 where
86 S: AsRef<OsStr>,
87 I: IntoIterator<Item = T>,
88 T: AsRef<OsStr>,
89 {
90 let mut new_argv = Vec::new();
91
92 // Add wrapper arguments first
93 for arg in wrapper_args {
94 new_argv.push(arg.as_ref().to_owned());
95 }
96
97 // Add the current program
98 new_argv.push(self.program.clone());
99
100 // Add the current arguments
101 new_argv.extend(self.argv.iter().cloned());
102
103 // Update program to wrapper and argv to the new argument list
104 self.program = wrapper.as_ref().to_owned();
105 self.argv = new_argv;
106 self
107 }
108
109 pub fn wrap_with(&mut self, wrapper_cmd: CommandBuilder) -> &mut Self {
110 let mut new_argv = Vec::new();

Callers 7

test_wrap_with_argsFunction · 0.80
test_wrap_without_argsFunction · 0.80
test_multiple_wrapsFunction · 0.80
test_wrap_with_spacesFunction · 0.80
test_wrap_and_buildFunction · 0.80
wrap_with_envFunction · 0.80
wrap_with_sudoFunction · 0.80

Calls

no outgoing calls

Tested by 5

test_wrap_with_argsFunction · 0.64
test_wrap_without_argsFunction · 0.64
test_multiple_wrapsFunction · 0.64
test_wrap_with_spacesFunction · 0.64
test_wrap_and_buildFunction · 0.64