@@ -89,7 +89,7 @@ impl Context {
8989 pub ( crate ) fn is_constructor_function ( & self ) -> bool {
9090 self . function
9191 . as_ref ( )
92- . map_or ( false , |f| matches ! ( f. ty, FunctionTy :: Constructor ) )
92+ . is_some_and ( |f| matches ! ( f. ty, FunctionTy :: Constructor ) )
9393 }
9494}
9595
@@ -348,7 +348,7 @@ impl<'a, W: Write> Formatter<'a, W> {
348348 } ;
349349
350350 self . find_next_line ( start_from)
351- . map_or ( false , |loc| loc >= end_at)
351+ . is_some_and ( |loc| loc >= end_at)
352352 }
353353 }
354354 }
@@ -549,7 +549,7 @@ impl<'a, W: Write> Formatter<'a, W> {
549549 fn write_doc_block_line ( & mut self , comment : & CommentWithMetadata , line : & str ) -> Result < ( ) > {
550550 if line. trim ( ) . starts_with ( '*' ) {
551551 let line = line. trim ( ) . trim_start_matches ( '*' ) ;
552- let needs_space = line. chars ( ) . next ( ) . map_or ( false , |ch| !ch. is_whitespace ( ) ) ;
552+ let needs_space = line. chars ( ) . next ( ) . is_some_and ( |ch| !ch. is_whitespace ( ) ) ;
553553 write ! ( self . buf( ) , " *{}" , if needs_space { " " } else { "" } ) ?;
554554 self . write_comment_line ( comment, line) ?;
555555 self . write_whitespace_separator ( true ) ?;
@@ -1797,7 +1797,7 @@ impl<'a, W: Write> Formatter<'a, W> {
17971797}
17981798
17991799// Traverse the Solidity Parse Tree and write to the code formatter
1800- impl < ' a , W : Write > Visitor for Formatter < ' a , W > {
1800+ impl < W : Write > Visitor for Formatter < ' _ , W > {
18011801 type Error = FormatterError ;
18021802
18031803 #[ instrument( name = "source" , skip( self ) ) ]
@@ -1862,7 +1862,7 @@ impl<'a, W: Write> Visitor for Formatter<'a, W> {
18621862 ) ?;
18631863
18641864 // EOF newline
1865- if self . last_char ( ) . map_or ( true , |char| char != '\n' ) {
1865+ if self . last_char ( ) != Some ( '\n' ) {
18661866 writeln ! ( self . buf( ) ) ?;
18671867 }
18681868
@@ -3268,7 +3268,7 @@ impl<'a, W: Write> Visitor for Formatter<'a, W> {
32683268
32693269 // we can however check if the contract `is` the `base`, this however also does
32703270 // not cover all cases
3271- let is_contract_base = self . context . contract . as_ref ( ) . map_or ( false , |contract| {
3271+ let is_contract_base = self . context . contract . as_ref ( ) . is_some_and ( |contract| {
32723272 contract. base . iter ( ) . any ( |contract_base| {
32733273 contract_base
32743274 . name
@@ -3292,7 +3292,7 @@ impl<'a, W: Write> Visitor for Formatter<'a, W> {
32923292 . content
32933293 . chars ( )
32943294 . next ( )
3295- . map_or ( false , |c| c. is_lowercase ( ) ) ;
3295+ . is_some_and ( |c| c. is_lowercase ( ) ) ;
32963296 if is_lowercase && base_or_modifier. content . ends_with ( "()" ) {
32973297 base_or_modifier
32983298 . content
@@ -3904,14 +3904,14 @@ struct Transaction<'f, 'a, W> {
39043904 comments : Comments ,
39053905}
39063906
3907- impl < ' f , ' a , W > std:: ops:: Deref for Transaction < ' f , ' a , W > {
3907+ impl < ' a , W > std:: ops:: Deref for Transaction < ' _ , ' a , W > {
39083908 type Target = Formatter < ' a , W > ;
39093909 fn deref ( & self ) -> & Self :: Target {
39103910 self . fmt
39113911 }
39123912}
39133913
3914- impl < ' f , ' a , W > std:: ops:: DerefMut for Transaction < ' f , ' a , W > {
3914+ impl < W > std:: ops:: DerefMut for Transaction < ' _ , ' _ , W > {
39153915 fn deref_mut ( & mut self ) -> & mut Self :: Target {
39163916 self . fmt
39173917 }
0 commit comments