Skip to content

Commit 11cb7b8

Browse files
committed
fix: handle clippy errors
1 parent 744f9a3 commit 11cb7b8

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

crates/lockfile/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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> {

crates/package_json/src/lib.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff 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
}

tasks/benchmark/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use std::{fs, path::PathBuf};
1+
use std::{fs, path::Path};
22

33
use criterion::{Criterion, Throughput};
44
use mockito::ServerGuard;
55
use pico_args::Arguments;
66
use project_root::get_project_root;
77
use 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();

0 commit comments

Comments
 (0)