aboutsummaryrefslogtreecommitdiffstats
path: root/src/migration_handler.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/migration_handler.rs')
-rw-r--r--src/migration_handler.rs9
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()
+}