@@ -118,10 +118,7 @@ pub fn compare_envs(
118118// ── Vault management ─────────────────────────────────────────────────
119119
120120#[ tauri:: command]
121- pub fn setup_vault (
122- state : State < ' _ , AppState > ,
123- master_pw : String ,
124- ) -> Result < ( ) , String > {
121+ pub fn setup_vault ( state : State < ' _ , AppState > , master_pw : String ) -> Result < ( ) , String > {
125122 let mut vs = vault_state ( ) . lock ( ) ;
126123 let ( salt, password_hash) = vs. setup ( & master_pw) . map_err ( |e| e. to_string ( ) ) ?;
127124
@@ -137,10 +134,7 @@ pub fn setup_vault(
137134}
138135
139136#[ tauri:: command]
140- pub fn unlock_vault (
141- state : State < ' _ , AppState > ,
142- master_pw : String ,
143- ) -> Result < bool , String > {
137+ pub fn unlock_vault ( state : State < ' _ , AppState > , master_pw : String ) -> Result < bool , String > {
144138 let db = state. db . lock ( ) ;
145139
146140 let salt = db
@@ -216,10 +210,7 @@ pub fn change_password(
216210}
217211
218212#[ tauri:: command]
219- pub fn export_all (
220- state : State < ' _ , AppState > ,
221- target_dir : String ,
222- ) -> Result < u32 , String > {
213+ pub fn export_all ( state : State < ' _ , AppState > , target_dir : String ) -> Result < u32 , String > {
223214 let vs = vault_state ( ) . lock ( ) ;
224215 let encryptor = vs. get_encryptor ( ) . ok_or ( "Vault is locked" ) ?;
225216 let db = state. db . lock ( ) ;
@@ -228,14 +219,10 @@ pub fn export_all(
228219 let mut exported = 0u32 ;
229220
230221 for project in & projects {
231- let files = db
232- . get_env_files ( & project. id )
233- . map_err ( |e| e. to_string ( ) ) ?;
222+ let files = db. get_env_files ( & project. id ) . map_err ( |e| e. to_string ( ) ) ?;
234223
235224 for file in & files {
236- let vars = db
237- . get_env_variables ( & file. id )
238- . map_err ( |e| e. to_string ( ) ) ?;
225+ let vars = db. get_env_variables ( & file. id ) . map_err ( |e| e. to_string ( ) ) ?;
239226
240227 let mut content = String :: new ( ) ;
241228 for var in & vars {
@@ -253,8 +240,7 @@ pub fn export_all(
253240 let out_path = std:: path:: Path :: new ( & target_dir)
254241 . join ( & project. name )
255242 . join ( & file. filename ) ;
256- std:: fs:: create_dir_all ( out_path. parent ( ) . unwrap ( ) )
257- . map_err ( |e| e. to_string ( ) ) ?;
243+ std:: fs:: create_dir_all ( out_path. parent ( ) . unwrap ( ) ) . map_err ( |e| e. to_string ( ) ) ?;
258244 std:: fs:: write ( & out_path, & content) . map_err ( |e| e. to_string ( ) ) ?;
259245 exported += 1 ;
260246 }
@@ -287,10 +273,7 @@ pub fn search(
287273// ── File watcher ─────────────────────────────────────────────────────
288274
289275#[ tauri:: command]
290- pub fn start_watcher (
291- app : tauri:: AppHandle ,
292- state : State < ' _ , AppState > ,
293- ) -> Result < ( ) , String > {
276+ pub fn start_watcher ( app : tauri:: AppHandle , state : State < ' _ , AppState > ) -> Result < ( ) , String > {
294277 let db = state. db . lock ( ) ;
295278 let roots = db. get_roots ( ) . map_err ( |e| e. to_string ( ) ) ?;
296279 let root_paths: Vec < String > = roots. iter ( ) . map ( |r| r. path . clone ( ) ) . collect ( ) ;
0 commit comments