@@ -80,7 +80,7 @@ enum CommandName {
8080
8181struct ResolvedCommand < ' a > {
8282 command_name : CommandName ,
83- args : Cow < ' a , Vec < OsString > > ,
83+ args : Cow < ' a , [ OsString ] > ,
8484}
8585
8686#[ derive( Error , Debug ) ]
@@ -111,7 +111,7 @@ impl FailedShebangError {
111111async fn resolve_command < ' a > (
112112 command_name : & UnresolvedCommandName ,
113113 context : & ShellCommandContext ,
114- original_args : & ' a Vec < OsString > ,
114+ original_args : & ' a [ OsString ] ,
115115) -> Result < ResolvedCommand < ' a > , ResolveCommandError > {
116116 let command_path = match resolve_command_path (
117117 & command_name. name ,
@@ -125,8 +125,8 @@ async fn resolve_command<'a>(
125125 // only bother checking for a shebang when the path has a slash
126126 // in it because for global commands someone on Windows likely
127127 // won't have a script with a shebang in it on Windows
128- if Path :: new ( & command_name. name ) . components ( ) . count ( ) > 1 {
129- if let Some ( shebang) = resolve_shebang ( & command_path) . map_err ( |err| {
128+ if Path :: new ( & command_name. name ) . components ( ) . count ( ) > 1
129+ && let Some ( shebang) = resolve_shebang ( & command_path) . map_err ( |err| {
130130 ResolveCommandError :: FailedShebang ( FailedShebangError :: Any ( err. into ( ) ) )
131131 } ) ? {
132132 let ( shebang_command_name, mut args) = if shebang. string_split {
@@ -150,7 +150,6 @@ async fn resolve_command<'a>(
150150 args : Cow :: Owned ( args) ,
151151 } ) ;
152152 }
153- }
154153
155154 Ok ( ResolvedCommand {
156155 command_name : CommandName :: Resolved ( command_path) ,
0 commit comments