diff --git a/lib/src/database.rs b/lib/src/database.rs index c3ba445..0fca8bb 100644 --- a/lib/src/database.rs +++ b/lib/src/database.rs @@ -17,6 +17,7 @@ */ use std::path::Path; +use std::path::PathBuf; use directories::ProjectDirs; use sqlx::sqlite::Sqlite; @@ -41,9 +42,9 @@ async fn connect_with(filename: &Path) -> Result, sqlx::Error> { } /// Return the default filename for the database. -fn default_filename() -> Path { +fn default_filename() -> PathBuf { match ProjectDirs::from("me", "JulioBiason", "tin.sqlite3") { - Some(project_dir) => Path(project_dir.config_dir()), - None => Path("tin.sqlite3"), + Some(project_dir) => Path::new(project_dir.config_dir()).to_path_buf(), + None => Path::new("tin.sqlite3").to_path_buf(), } } diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 4054904..6dbc3ea 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -16,13 +16,5 @@ along with this program. If not, see . */ -// mod database; +mod database; mod domain; - -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - assert_eq!(2 + 2, 4); - } -}