From eab02b69e51165274af4b1e1df9625df5347a6a5 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 6 Jul 2022 10:38:14 +0000 Subject: [PATCH] rustfmt --- ui_test/src/comments.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/ui_test/src/comments.rs b/ui_test/src/comments.rs index fa46b5497000..727e6a2aa237 100644 --- a/ui_test/src/comments.rs +++ b/ui_test/src/comments.rs @@ -184,19 +184,22 @@ impl Comments { fn parse_command(&mut self, command: &str, l: usize) -> Result<()> { // Commands are letters or dashes, grab everything until the first character that is neither of those. - let (command, args) = match command.chars().position(|c: char| !c.is_alphabetic() && c != '-') { - None => (command, ""), - Some(i) => { - let (command, args) = command.split_at(i); - let mut args = args.chars(); - let next = args.next().expect("the `position` above guarantees that there is at least one char"); - let args = match next { - ':' | ' ' => args.as_str(), - _ => bail!("expected space or `:`, got `{next}`"), - }; - (command, args) - } - }; + let (command, args) = + match command.chars().position(|c: char| !c.is_alphabetic() && c != '-') { + None => (command, ""), + Some(i) => { + let (command, args) = command.split_at(i); + let mut args = args.chars(); + let next = args + .next() + .expect("the `position` above guarantees that there is at least one char"); + let args = match next { + ':' | ' ' => args.as_str(), + _ => bail!("expected space or `:`, got `{next}`"), + }; + (command, args) + } + }; match command { "revisions" => {