@@ -401,8 +401,7 @@ impl Settings {
401
401
/// Inserts the value for all files and contracts
402
402
///
403
403
/// ```
404
- /// use foundry_compilers::artifacts::output_selection::ContractOutputSelection;
405
- /// use foundry_compilers::artifacts::Settings;
404
+ /// use foundry_compilers::artifacts::{output_selection::ContractOutputSelection, Settings};
406
405
/// let mut selection = Settings::default();
407
406
/// selection.push_output_selection(ContractOutputSelection::Metadata);
408
407
/// ```
@@ -608,7 +607,7 @@ impl Libraries {
608
607
if items. next ( ) . is_some ( ) {
609
608
return Err ( SolcError :: msg ( format ! (
610
609
"failed to parse, too many arguments passed: {lib}"
611
- ) ) )
610
+ ) ) ) ;
612
611
}
613
612
libraries
614
613
. entry ( file. into ( ) )
@@ -741,15 +740,15 @@ pub struct OptimizerDetails {
741
740
impl OptimizerDetails {
742
741
/// Returns true if no settings are set.
743
742
pub fn is_empty ( & self ) -> bool {
744
- self . peephole . is_none ( ) &&
745
- self . inliner . is_none ( ) &&
746
- self . jumpdest_remover . is_none ( ) &&
747
- self . order_literals . is_none ( ) &&
748
- self . deduplicate . is_none ( ) &&
749
- self . cse . is_none ( ) &&
750
- self . constant_optimizer . is_none ( ) &&
751
- self . yul . is_none ( ) &&
752
- self . yul_details . as_ref ( ) . map ( |yul| yul. is_empty ( ) ) . unwrap_or ( true )
743
+ self . peephole . is_none ( )
744
+ && self . inliner . is_none ( )
745
+ && self . jumpdest_remover . is_none ( )
746
+ && self . order_literals . is_none ( )
747
+ && self . deduplicate . is_none ( )
748
+ && self . cse . is_none ( )
749
+ && self . constant_optimizer . is_none ( )
750
+ && self . yul . is_none ( )
751
+ && self . yul_details . as_ref ( ) . map ( |yul| yul. is_empty ( ) ) . unwrap_or ( true )
753
752
}
754
753
}
755
754
@@ -1900,7 +1899,7 @@ impl fmt::Display for Error {
1900
1899
let msg = self . formatted_message . as_ref ( ) . unwrap_or ( & self . message ) ;
1901
1900
self . fmt_severity ( f) ?;
1902
1901
f. write_str ( ": " ) ?;
1903
- return f. write_str ( msg)
1902
+ return f. write_str ( msg) ;
1904
1903
}
1905
1904
1906
1905
// Error (XXXX): Error Message
@@ -2029,7 +2028,7 @@ fn fmt_source_location(f: &mut fmt::Formatter, lines: &mut std::str::Lines) -> f
2029
2028
f. write_str ( "\n " ) ?;
2030
2029
f. write_str ( line) ?;
2031
2030
}
2032
- return Ok ( ( ) )
2031
+ return Ok ( ( ) ) ;
2033
2032
} ;
2034
2033
2035
2034
// line 1, just a frame
@@ -2070,7 +2069,7 @@ fn fmt_framed_location(
2070
2069
if let Some ( ( space_or_line_number, rest) ) = line. split_once ( '|' ) {
2071
2070
// if the potential frame is not just whitespace or numbers, don't color it
2072
2071
if !space_or_line_number. chars ( ) . all ( |c| c. is_whitespace ( ) || c. is_numeric ( ) ) {
2073
- return f. write_str ( line)
2072
+ return f. write_str ( line) ;
2074
2073
}
2075
2074
2076
2075
styled ( f, Error :: frame_style ( ) , |f| {
@@ -2187,7 +2186,7 @@ impl SourceFile {
2187
2186
pub fn contains_contract_definition ( & self ) -> bool {
2188
2187
if let Some ( ref ast) = self . ast {
2189
2188
// contract definitions are only allowed at the source-unit level <https://docs.soliditylang.org/en/latest/grammar.html>
2190
- return ast. nodes . iter ( ) . any ( |node| node. node_type == NodeType :: ContractDefinition )
2189
+ return ast. nodes . iter ( ) . any ( |node| node. node_type == NodeType :: ContractDefinition ) ;
2191
2190
// abstract contract, interfaces: ContractDefinition
2192
2191
}
2193
2192
@@ -2204,10 +2203,10 @@ impl SourceFiles {
2204
2203
/// Returns an iterator over the source files' ids and path
2205
2204
///
2206
2205
/// ```
2207
- /// use std::collections::BTreeMap;
2208
2206
/// use foundry_compilers::artifacts::SourceFiles;
2207
+ /// use std::collections::BTreeMap;
2209
2208
/// # fn demo(files: SourceFiles) {
2210
- /// let sources: BTreeMap<u32,String> = files.into_ids().collect();
2209
+ /// let sources: BTreeMap<u32, String> = files.into_ids().collect();
2211
2210
/// # }
2212
2211
/// ```
2213
2212
pub fn into_ids ( self ) -> impl Iterator < Item = ( u32 , String ) > {
@@ -2217,10 +2216,10 @@ impl SourceFiles {
2217
2216
/// Returns an iterator over the source files' paths and ids
2218
2217
///
2219
2218
/// ```
2220
- /// use std::collections::BTreeMap;
2221
2219
/// use foundry_compilers::artifacts::SourceFiles;
2220
+ /// use std::collections::BTreeMap;
2222
2221
/// # fn demo(files: SourceFiles) {
2223
- /// let sources : BTreeMap<String, u32> = files.into_paths().collect();
2222
+ /// let sources: BTreeMap<String, u32> = files.into_paths().collect();
2224
2223
/// # }
2225
2224
/// ```
2226
2225
pub fn into_paths ( self ) -> impl Iterator < Item = ( String , u32 ) > {
0 commit comments