]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/remove_remote.rs
Add CI
[rbdr/blog] / src / command / remove_remote.rs
index b2f554cc2a7e0427adc53f1e8d9c656d540734a0..7590487d677a6a9f0507c34584d6867c187cd18d 100644 (file)
@@ -1,6 +1,6 @@
-use std::fs::remove_file;
 use std::io::Result;
 use crate::configuration::Configuration;
+use crate::remote::remove;
 
 pub struct RemoveRemote;
 
@@ -16,10 +16,7 @@ impl super::Command for RemoveRemote {
     }
 
     fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
-        if configuration.remote_config.exists() {
-            remove_file(&configuration.remote_config)?;
-        }
-        return Ok(())
+        remove(&configuration.remote_config)
     }
 
     fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {