chore: simplify
This commit is contained in:
parent
8d8857cace
commit
ff090c9d68
@ -22,11 +22,7 @@ pub async fn open<T: AsRef<str>>(path: T) -> Result<SqlitePool, String> {
|
||||
|
||||
pub async fn new<T: AsRef<str>>(path: T) -> Result<SqlitePool, String> {
|
||||
std::fs::File::create_new(path.as_ref()).map_err(|e| e.to_string())?;
|
||||
let db_url = format!("sqlite://{}", path.as_ref());
|
||||
|
||||
SqlitePool::connect(&db_url)
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
open(path).await
|
||||
}
|
||||
|
||||
pub async fn import_scripts(pool: &SqlitePool, scripts: Vec<Script>) -> Result<(), String> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user