]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/backup/catalog_shell.rs
cli: avoid useless .into()
[proxmox-backup.git] / src / backup / catalog_shell.rs
index ce37d976673f038a4f873b0920182c6e9a9ac6d2..66b2529e32b55216f86c3c11646d64af108b19e3 100644 (file)
@@ -25,62 +25,55 @@ pub struct Shell {
 
 /// This list defines all the shell commands and their properties
 /// using the api schema
-pub fn catalog_shell_api() -> CommandLineInterface {
+pub fn catalog_shell_cli() -> CommandLineInterface {
 
     let map = CliCommandMap::new()
-        .insert("pwd", CliCommand::new(&API_METHOD_PWD_COMMAND).into())
+        .insert("pwd", CliCommand::new(&API_METHOD_PWD_COMMAND))
         .insert(
             "cd",
             CliCommand::new(&API_METHOD_CD_COMMAND)
                 .arg_param(&["path"])
                 .completion_cb("path", Shell::complete_path)
-                .into(),
         )
         .insert(
             "ls",
             CliCommand::new(&API_METHOD_LS_COMMAND)
                 .arg_param(&["path"])
                 .completion_cb("path", Shell::complete_path)
-                .into(),
-        )
+         )
         .insert(
             "stat",
             CliCommand::new(&API_METHOD_STAT_COMMAND)
                 .arg_param(&["path"])
                 .completion_cb("path", Shell::complete_path)
-                .into(),
-        )
+         )
         .insert(
             "select",
             CliCommand::new(&API_METHOD_SELECT_COMMAND)
                 .arg_param(&["path"])
                 .completion_cb("path", Shell::complete_path)
-                .into(),
         )
         .insert(
             "deselect",
             CliCommand::new(&API_METHOD_DESELECT_COMMAND)
                 .arg_param(&["path"])
                 .completion_cb("path", Shell::complete_path)
-                .into(),
         )
         .insert(
             "restore-selected",
             CliCommand::new(&API_METHOD_RESTORE_SELECTED_COMMAND)
                 .arg_param(&["target"])
                 .completion_cb("target", tools::complete_file_name)
-                .into(),
         )
         .insert(
             "list-selected",
-            CliCommand::new(&API_METHOD_LIST_SELECTED_COMMAND).into(),
+            CliCommand::new(&API_METHOD_LIST_SELECTED_COMMAND),
         )
         .insert(
             "restore",
             CliCommand::new(&API_METHOD_RESTORE_COMMAND)
                 .arg_param(&["target"])
                 .completion_cb("target", tools::complete_file_name)
-                .into(),
         )
         .insert_help();
 
@@ -110,7 +103,7 @@ impl Shell {
             });
         });
 
-        let cli_helper = CliHelper::new(catalog_shell_api());
+        let cli_helper = CliHelper::new(catalog_shell_cli());
         let mut rl = rustyline::Editor::<CliHelper>::new();
         rl.set_helper(Some(cli_helper));