File tree Expand file tree Collapse file tree
crates/pyrefly_config/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ pub enum ConfigSource {
6767}
6868
6969impl ConfigSource {
70- pub fn root < ' a > ( & ' a self ) -> Option < & ' a Path > {
70+ pub fn root ( & self ) -> Option < & Path > {
7171 match & self {
7272 Self :: File ( path) | Self :: Marker ( path) => path. parent ( ) ,
7373 Self :: Synthetic => None ,
@@ -387,14 +387,14 @@ impl ConfigFile {
387387 self . python_environment . python_platform . as_ref ( ) . unwrap ( )
388388 }
389389
390- pub fn search_path < ' a > ( & ' a self ) -> impl Iterator < Item = & ' a PathBuf > + Clone {
390+ pub fn search_path ( & self ) -> impl Iterator < Item = & PathBuf > + Clone {
391391 self . search_path_from_args
392392 . iter ( )
393393 . chain ( self . search_path_from_file . iter ( ) )
394394 . chain ( self . import_root . iter ( ) )
395395 }
396396
397- pub fn site_package_path < ' a > ( & ' a self ) -> impl Iterator < Item = & ' a PathBuf > + Clone {
397+ pub fn site_package_path ( & self ) -> impl Iterator < Item = & PathBuf > + Clone {
398398 // we can use unwrap here, because the value in the root config must
399399 // be set in `ConfigFile::configure()`.
400400 self . python_environment
Original file line number Diff line number Diff line change @@ -119,10 +119,7 @@ pub enum DiagnosticLevel {
119119
120120impl DiagnosticLevel {
121121 fn to_bool ( & self ) -> bool {
122- match self {
123- Self :: None => false ,
124- _ => true ,
125- }
122+ !matches ! ( self , Self :: None )
126123 }
127124}
128125
Original file line number Diff line number Diff line change @@ -142,10 +142,7 @@ impl<T> ConfigOrigin<T> {
142142 /// We only serialize if the value is `Some(ConfigFile)`. All other
143143 /// [`Option`] and [`ConfigOrigin`] variants are not serialized.
144144 pub ( crate ) fn should_skip_serializing_option ( origin : & Option < Self > ) -> bool {
145- match origin {
146- Some ( Self :: ConfigFile ( _) ) => false ,
147- _ => true ,
148- }
145+ !matches ! ( origin, Some ( Self :: ConfigFile ( _) ) )
149146 }
150147}
151148
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ async fn main() -> ExitCode {
5858 Err ( e) => {
5959 // If you return a Result from main, and RUST_BACKTRACE=1 is set, then
6060 // it will print a backtrace - which is not what we want.
61- eprintln ! ( "{:#}" , e ) ;
61+ eprintln ! ( "{e :#}" ) ;
6262 ExitCode :: FAILURE
6363 }
6464 }
You can’t perform that action at this time.
0 commit comments