parser : String::default -> String::new
This commit is contained in:
parent
1e4f8cadd6
commit
5df428a364
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@ use crate::command::command_builder::CommandBuilder;
|
||||||
use crate::command::command_sequence::CommandSequence;
|
use crate::command::command_sequence::CommandSequence;
|
||||||
|
|
||||||
fn parse_quote(characters: &mut Vec<char>) -> String {
|
fn parse_quote(characters: &mut Vec<char>) -> String {
|
||||||
let mut quoted = String::default();
|
let mut quoted = String::new();
|
||||||
|
|
||||||
if !characters.is_empty() {
|
if !characters.is_empty() {
|
||||||
let mut current_char = characters.pop().unwrap();
|
let mut current_char = characters.pop().unwrap();
|
||||||
|
@ -35,7 +35,7 @@ fn parse_main(characters: &mut Vec<char>, current_arg: &mut String) -> Vec<Strin
|
||||||
if current_char.is_whitespace() {
|
if current_char.is_whitespace() {
|
||||||
if !current_arg.is_empty() {
|
if !current_arg.is_empty() {
|
||||||
let mut argv: Vec<String> = vec![current_arg.clone()];
|
let mut argv: Vec<String> = vec![current_arg.clone()];
|
||||||
argv.append(&mut parse_main(characters, &mut String::default()));
|
argv.append(&mut parse_main(characters, &mut String::new()));
|
||||||
|
|
||||||
argv
|
argv
|
||||||
} else {
|
} else {
|
||||||
|
@ -72,7 +72,7 @@ pub fn parse(line: String) -> CommandSequence {
|
||||||
let mut command_sequence = CommandSequence::new();
|
let mut command_sequence = CommandSequence::new();
|
||||||
|
|
||||||
while !characters.is_empty() {
|
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() {
|
if !argv.is_empty() {
|
||||||
let command = CommandBuilder::new(argv).build();
|
let command = CommandBuilder::new(argv).build();
|
||||||
|
|
Loading…
Reference in a new issue