diff options
| author | Nathan Jaremko | 2019-03-02 20:30:54 -0500 |
|---|---|---|
| committer | Nathan Jaremko | 2019-03-02 20:30:54 -0500 |
| commit | 9c9fb906cd6c05105d96fa586f429764b12169ca (patch) | |
| tree | 1499d2e38c368952886fb72a01251be47448603c /src/migration_handler.rs | |
| parent | 2d34d8e812f3e85b0d10f126bf5f334847d0fbca (diff) | |
| download | podcast-9c9fb906cd6c05105d96fa586f429764b12169ca.tar.bz2 | |
0.10.0 - Lots of Improvements
Diffstat (limited to 'src/migration_handler.rs')
| -rw-r--r-- | src/migration_handler.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/migration_handler.rs b/src/migration_handler.rs index 73a0241..9f8fbc4 100644 --- a/src/migration_handler.rs +++ b/src/migration_handler.rs @@ -2,15 +2,18 @@ use crate::errors::*; use crate::utils::*; use std::fs; -pub fn migrate_old_subscriptions() -> Result<()> { +fn migrate_old_subscriptions() -> Result<()> { let path = get_podcast_dir()?; let mut old_path = path.clone(); old_path.push(".subscriptions"); if old_path.exists() { println!("Migrating old subscriptions file..."); let new_path = get_sub_file()?; - fs::rename(&old_path, &new_path) - .chain_err(|| format!("Unable to move {:?} to {:?}", &old_path, &new_path))?; + fs::rename(&old_path, &new_path)?; } Ok(()) } + +pub fn migrate() -> Result<()> { + migrate_old_subscriptions() +} |
