Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrilim committed Jan 18, 2023
1 parent e89f04b commit 50023de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Runtfile {
}

fn root_command(&self) -> &Command {
&self.commands.iter().next().unwrap().1
self.commands.iter().next().unwrap().1
}
}

Expand Down Expand Up @@ -99,7 +99,7 @@ fn parse(input: &str) -> Runtfile {
if cmd.name.is_empty() {
cmd.name = String::from_utf8(text.clone())
.unwrap()
.replace(" ", "-")
.replace(' ', "-")
.to_lowercase();
} else {
cmd.description = String::from_utf8(text.clone()).unwrap();
Expand All @@ -116,7 +116,7 @@ fn parse(input: &str) -> Runtfile {
subcommands: vec![],
});
let parent = runtfile.command_mut(parent_index);
parent.subcommands.push(index.clone());
parent.subcommands.push(index);
cmd_idx = index;
}
}
Expand Down Expand Up @@ -206,7 +206,7 @@ fn main() -> io::Result<()> {
let runtfile = parse(&runtfile);
let cli = build_cli_from_runtfile(cli, &runtfile);
let matches = cli.get_matches();
let (cmd, args) = match_command(&runtfile, &matches, &runtfile.root_command());
let (cmd, args) = match_command(&runtfile, &matches, runtfile.root_command());
let cmd = cmd.unwrap();
match cmd.script {
Script::Javascript => eval::javascript(&cmd.code, args),
Expand Down

0 comments on commit 50023de

Please sign in to comment.