From 5df428a364f1e6d26ec7ff2a54507c7d41ae6c41 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Mon, 15 Apr 2024 16:54:09 +0200 Subject: [PATCH] parser : String::default -> String::new --- src/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 935f17d..97a69f6 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -2,7 +2,7 @@ use crate::command::command_builder::CommandBuilder; use crate::command::command_sequence::CommandSequence; fn parse_quote(characters: &mut Vec) -> String { - let mut quoted = String::default(); + let mut quoted = String::new(); if !characters.is_empty() { let mut current_char = characters.pop().unwrap(); @@ -35,7 +35,7 @@ fn parse_main(characters: &mut Vec, current_arg: &mut String) -> Vec = vec![current_arg.clone()]; - argv.append(&mut parse_main(characters, &mut String::default())); + argv.append(&mut parse_main(characters, &mut String::new())); argv } else { @@ -72,7 +72,7 @@ pub fn parse(line: String) -> CommandSequence { let mut command_sequence = CommandSequence::new(); while !characters.is_empty() { - let argv = parse_main(&mut characters, &mut String::default()); + let argv = parse_main(&mut characters, &mut String::new()); if !argv.is_empty() { let command = CommandBuilder::new(argv).build();