Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bb16d21 authored by George Burgess IV's avatar George Burgess IV
Browse files

use &str consistently

This code is currently converting an &str to a String, to a &String,
back to a &str. It's cleaner if we skip the round-trip.

Tag: #floss
Bug: 239449434
Test: TreeHugger

Change-Id: Ie23109b82108091e81b65ff5c038bfe6d4c6489b
parent 2f8e631e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -286,9 +286,9 @@ impl CommandHandler {
    }

    /// Entry point for command and arguments
    pub fn process_cmd_line(&mut self, command: &String, args: &Vec<String>) {
    pub fn process_cmd_line(&mut self, command: &str, args: &Vec<String>) {
        // Ignore empty line
        match &command[..] {
        match command {
            "" => {}
            _ => match self.command_options.get(command) {
                Some(cmd) => {
+2 −3
Original line number Diff line number Diff line
@@ -594,12 +594,11 @@ async fn start_interactive_shell(
                            None => break,
                        };

                        if cmd.eq("quit") {
                        if cmd == "quit" {
                            break 'readline;
                        }

                        handler.process_cmd_line(&String::from(cmd), &rest.to_vec());

                        handler.process_cmd_line(cmd, &rest.to_vec());
                        break;
                    }