File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,11 @@ impl Lockfile {
9898
9999 pub fn create_or_open ( ) -> Result < Lockfile , LockfileError > {
100100 let yaml_path = Lockfile :: path ( ) ?;
101- if yaml_path. exists ( ) { Ok ( Lockfile :: open ( ) ?) } else { Ok ( Lockfile :: create ( ) ?) }
101+ if yaml_path. exists ( ) {
102+ Ok ( Lockfile :: open ( ) ?)
103+ } else {
104+ Ok ( Lockfile :: create ( ) ?)
105+ }
102106 }
103107
104108 pub fn save ( & self ) -> Result < ( ) , LockfileError > {
Original file line number Diff line number Diff line change @@ -189,7 +189,11 @@ impl PackageJson {
189189 }
190190 }
191191
192- if if_present { Ok ( None ) } else { Err ( PackageJsonError :: NoScript ( command. to_string ( ) ) ) }
192+ if if_present {
193+ Ok ( None )
194+ } else {
195+ Err ( PackageJsonError :: NoScript ( command. to_string ( ) ) )
196+ }
193197 }
194198}
195199
@@ -291,13 +295,11 @@ mod tests {
291295 let tmp = NamedTempFile :: new ( ) . unwrap ( ) ;
292296 write ! ( tmp. as_file( ) , "{}" , data) . unwrap ( ) ;
293297 let package_json = PackageJson :: create_if_needed ( & tmp. path ( ) . to_path_buf ( ) ) . unwrap ( ) ;
294- assert ! (
295- package_json
296- . get_dependencies( vec![ DependencyGroup :: Peer ] )
297- . contains_key( "fast-querystring" )
298- ) ;
299- assert ! (
300- package_json. get_dependencies( vec![ DependencyGroup :: Default ] ) . contains_key( "fastify" )
301- ) ;
298+ assert ! ( package_json
299+ . get_dependencies( vec![ DependencyGroup :: Peer ] )
300+ . contains_key( "fast-querystring" ) ) ;
301+ assert ! ( package_json
302+ . get_dependencies( vec![ DependencyGroup :: Default ] )
303+ . contains_key( "fastify" ) ) ;
302304 }
303305}
Original file line number Diff line number Diff line change 1- use std:: { fs, path:: PathBuf } ;
1+ use std:: { fs, path:: Path } ;
22
33use criterion:: { Criterion , Throughput } ;
44use mockito:: ServerGuard ;
55use pico_args:: Arguments ;
66use project_root:: get_project_root;
77use tempfile:: tempdir;
88
9- fn bench_tarball ( c : & mut Criterion , server : & mut ServerGuard , fixtures_folder : & PathBuf ) {
9+ fn bench_tarball ( c : & mut Criterion , server : & mut ServerGuard , fixtures_folder : & Path ) {
1010 let mut group = c. benchmark_group ( "tarball" ) ;
1111 let file = fs:: read ( fixtures_folder. join ( "@fastify+error-3.3.0.tgz" ) ) . unwrap ( ) ;
1212 server. mock ( "GET" , "/@fastify+error-3.3.0.tgz" ) . with_status ( 201 ) . with_body ( & file) . create ( ) ;
You can’t perform that action at this time.
0 commit comments