Skip to content

Commit a0a8d56

Browse files
committed
format
1 parent f299d52 commit a0a8d56

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

plugins/bntl_utils/src/command/create.rs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ pub struct CompilerOptionsField;
128128

129129
impl CompilerOptionsField {
130130
pub fn field() -> FormInputField {
131-
FormInputField::MultilineText {
132-
prompt: "Compiler options".to_string(),
133-
default: None,
134-
value: None,
131+
FormInputField::MultilineText {
132+
prompt: "Compiler options".to_string(),
133+
default: None,
134+
value: None,
135135
}
136136
}
137137

@@ -152,7 +152,7 @@ impl CreateFromDirectory {
152152
form.add_field(NameField::field());
153153
form.add_field(OutputDirectoryField::field());
154154
form.add_field(CompilerOptionsField::field());
155-
155+
156156
if !form.prompt() {
157157
return;
158158
}
@@ -304,13 +304,24 @@ fn split_args(input: &str) -> Vec<String> {
304304

305305
for c in input.chars() {
306306
match c {
307-
'"' => { in_quote = !in_quote; has_token = true; }
307+
'"' => {
308+
in_quote = !in_quote;
309+
has_token = true;
310+
}
308311
c if c.is_whitespace() && !in_quote => {
309-
if has_token { args.push(std::mem::take(&mut cur)); has_token = false; }
312+
if has_token {
313+
args.push(std::mem::take(&mut cur));
314+
has_token = false;
315+
}
316+
}
317+
c => {
318+
cur.push(c);
319+
has_token = true;
310320
}
311-
c => { cur.push(c); has_token = true; }
312321
}
313322
}
314-
if has_token { args.push(cur); }
323+
if has_token {
324+
args.push(cur);
325+
}
315326
args
316327
}

0 commit comments

Comments
 (0)