1- use std:: { collections:: HashSet , path:: PathBuf } ;
1+ use std:: { collections:: HashSet , path:: Path } ;
22
33use sqlx:: { types:: chrono:: Utc , PgConnection } ;
44use tokio:: fs;
@@ -10,7 +10,7 @@ use crate::{
1010
1111pub async fn add (
1212 payload : & Payload ,
13- output_path : & PathBuf ,
13+ output_path : & Path ,
1414 mut conn : PgConnection ,
1515) -> anyhow:: Result < ( ) > {
1616 let existing_versions = extension_versions ( & mut conn, & payload. metadata . extension_name ) . await ?;
@@ -35,7 +35,7 @@ pub async fn add(
3535
3636 if let Some ( comment) = & payload. metadata . comment {
3737 migration_content. push_str ( "-- Comment:" ) ;
38- migration_content. push_str ( & comment) ;
38+ migration_content. push_str ( comment) ;
3939 migration_content. push ( '\n' ) ;
4040 }
4141
@@ -86,7 +86,7 @@ pub async fn add(
8686 migration_content. push_str ( "', '" ) ;
8787 migration_content. push_str ( & install_file. version ) ;
8888 migration_content. push_str ( "', $COMMENT$" ) ;
89- migration_content. push_str ( & payload. metadata . comment . as_deref ( ) . unwrap_or ( "" ) ) ;
89+ migration_content. push_str ( payload. metadata . comment . as_deref ( ) . unwrap_or ( "" ) ) ;
9090 migration_content. push_str ( "$COMMENT$, $SQL$" ) ;
9191 migration_content. push_str ( & install_file. body ) ;
9292 migration_content. push_str ( "$SQL$, ARRAY[" ) ;
@@ -100,10 +100,7 @@ pub async fn add(
100100 }
101101
102102 let existing_update_paths =
103- match update_paths ( & mut conn, & payload. metadata . extension_name ) . await {
104- Ok ( paths) => paths,
105- Err ( _) => HashSet :: new ( ) ,
106- } ;
103+ ( update_paths ( & mut conn, & payload. metadata . extension_name ) . await ) . unwrap_or_default ( ) ;
107104
108105 for upgrade_file in & payload. upgrade_files {
109106 let update_path = UpdatePath {
0 commit comments