File tree Expand file tree Collapse file tree 5 files changed +28
-30
lines changed
gtk/src/collection_object Expand file tree Collapse file tree 5 files changed +28
-30
lines changed Original file line number Diff line number Diff line change @@ -1312,10 +1312,10 @@ fn get_translation_catalog() -> gettext::Catalog {
13121312
13131313 if let Ok ( langid) = langid_res {
13141314 let file = std:: fs:: File :: open ( format ! ( "{}/{}.mo" , loc, langid. language) ) ;
1315- if let Ok ( file) = file {
1316- if let Ok ( catalog) = gettext:: Catalog :: parse ( file) {
1317- return catalog ;
1318- }
1315+ if let Ok ( file) = file
1316+ && let Ok ( catalog) = gettext:: Catalog :: parse ( file)
1317+ {
1318+ return catalog ;
13191319 }
13201320 }
13211321 }
@@ -1329,10 +1329,10 @@ fn get_translation_catalog() -> gettext::Catalog {
13291329 "/usr/share/locale/{}/LC_MESSAGES/ripasso-cursive.mo" ,
13301330 langid. language
13311331 ) ) ;
1332- if let Ok ( file) = file {
1333- if let Ok ( catalog) = gettext:: Catalog :: parse ( file) {
1334- return catalog ;
1335- }
1332+ if let Ok ( file) = file
1333+ && let Ok ( catalog) = gettext:: Catalog :: parse ( file)
1334+ {
1335+ return catalog ;
13361336 }
13371337 }
13381338 }
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ impl CollectionObject {
2929 store : Arc < Mutex < PasswordStore > > ,
3030 user_config_dir : & Path ,
3131 ) -> Self {
32- let co = Object :: builder ( )
32+ Object :: builder ( )
3333 . property ( "title" , title)
3434 . property ( "passwords" , passwords)
3535 . property ( "store" , PasswordStoreBoxed ( store) )
@@ -39,9 +39,7 @@ impl CollectionObject {
3939 . to_str ( )
4040 . expect ( "can't have non-utf8 in path" ) ,
4141 )
42- . build ( ) ;
43-
44- co
42+ . build ( )
4543 }
4644
4745 pub fn passwords ( & self ) -> gio:: ListStore {
Original file line number Diff line number Diff line change @@ -477,10 +477,10 @@ impl VerificationHelper for Helper<'_> {
477477 }
478478
479479 for layer in structure {
480- if let MessageLayer :: SignatureGroup { results } = layer {
481- if results. iter ( ) . any ( std:: result:: Result :: is_ok) {
482- return Ok ( ( ) ) ;
483- }
480+ if let MessageLayer :: SignatureGroup { results } = layer
481+ && results. iter ( ) . any ( std:: result:: Result :: is_ok)
482+ {
483+ return Ok ( ( ) ) ;
484484 }
485485 }
486486 Err ( anyhow:: anyhow!( "No valid signature" ) )
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ pub fn commit(
7575 }
7676}
7777
78- pub fn find_last_commit ( repo : & Repository ) -> Result < git2:: Commit > {
78+ pub fn find_last_commit ( repo : & Repository ) -> Result < git2:: Commit < ' _ > > {
7979 let obj = repo. head ( ) ?. resolve ( ) ?. peel ( git2:: ObjectType :: Commit ) ?;
8080 obj. into_commit ( )
8181 . map_err ( |_| Error :: Generic ( "Couldn't find commit" ) )
@@ -205,7 +205,7 @@ pub fn move_and_commit(
205205/// find the origin of the git repo, with the following strategy:
206206/// find the branch that HEAD points to, and read the remote configured for that branch
207207/// returns the remote and the name of the local branch
208- fn find_origin ( repo : & Repository ) -> Result < ( git2:: Remote , String ) > {
208+ fn find_origin ( repo : & Repository ) -> Result < ( git2:: Remote < ' _ > , String ) > {
209209 for branch in repo. branches ( Some ( git2:: BranchType :: Local ) ) ? {
210210 let b = branch?. 0 ;
211211 if b. is_head ( ) {
Original file line number Diff line number Diff line change @@ -355,12 +355,12 @@ impl PasswordStore {
355355 if path_iter. peek ( ) . is_some ( ) {
356356 path. push ( p) ;
357357 let c_file_res = fs:: canonicalize ( path. as_path ( ) ) ;
358- if let Ok ( c_file) = c_file_res {
359- if !c_file. starts_with ( c_path. as_path ( ) ) {
360- return Err ( Error :: Generic (
361- "trying to write outside of password store directory" ,
362- ) ) ;
363- }
358+ if let Ok ( c_file) = c_file_res
359+ && !c_file. starts_with ( c_path. as_path ( ) )
360+ {
361+ return Err ( Error :: Generic (
362+ "trying to write outside of password store directory" ,
363+ ) ) ;
364364 }
365365 if !path. exists ( ) {
366366 fs:: create_dir ( & path) ?;
@@ -452,12 +452,12 @@ impl PasswordStore {
452452 return true ;
453453 }
454454
455- if let Ok ( repo) = self . repo ( ) {
456- if let Ok ( config) = repo. config ( ) {
457- let user_name = config . get_string ( "user.name" ) ;
458- if user_name . is_ok ( ) {
459- return true ;
460- }
455+ if let Ok ( repo) = self . repo ( )
456+ && let Ok ( config) = repo. config ( )
457+ {
458+ let user_name = config . get_string ( "user.name" ) ;
459+ if user_name . is_ok ( ) {
460+ return true ;
461461 }
462462 }
463463
You can’t perform that action at this time.
0 commit comments