mirror of
https://github.com/orhun/systeroid
synced 2024-07-09 04:06:06 +00:00
refactor(lint): remove trim before splitting by whitespace
This commit is contained in:
parent
8c2862caae
commit
16dd491d4c
|
@ -47,17 +47,14 @@ impl FromStr for Command {
|
|||
"exit" | "quit" | "q" | "q!" => Ok(Command::Exit),
|
||||
_ => {
|
||||
if s.starts_with("set") {
|
||||
let values: Vec<&str> = s
|
||||
.trim_start_matches("set")
|
||||
.trim()
|
||||
.split_whitespace()
|
||||
.collect();
|
||||
let values: Vec<&str> =
|
||||
s.trim_start_matches("set").split_whitespace().collect();
|
||||
Ok(Command::Set(
|
||||
values.first().ok_or(())?.to_string(),
|
||||
values[1..].join(" "),
|
||||
))
|
||||
} else if s.starts_with("scroll") {
|
||||
let mut values = s.trim_start_matches("scroll").trim().split_whitespace();
|
||||
let mut values = s.trim_start_matches("scroll").split_whitespace();
|
||||
Ok(Command::Scroll(
|
||||
ScrollArea::try_from(values.next().ok_or(())?)?,
|
||||
Direction::try_from(values.next().ok_or(())?)?,
|
||||
|
|
Loading…
Reference in New Issue
Block a user