aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index d484e5e..77f230a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -51,8 +51,8 @@ impl Alias {
}
fn write_to_file<P: AsRef<Path>>(&self, file: P) -> Result<(), io::Error> {
- let mut f = try!(OpenOptions::new().write(true).open(file));
- try!(f.write_all(self.to_string().as_bytes()));
+ let mut f = try!(OpenOptions::new().append(true).open(file));
+ try!(f.write_all(format!("{}\n", self.to_string()).as_bytes()));
Ok(())
}