Skip to content

Commit 2bdac84

Browse files
committed
Switching precise check from match to is_none()
1 parent 06eed4a commit 2bdac84

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/cargo/ops/cargo_generate_lockfile.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,8 @@ pub fn update_lockfile(ws: &Workspace<'_>, opts: &UpdateOptions<'_>) -> CargoRes
4444
anyhow::bail!("you can't generate a lockfile for an empty workspace.")
4545
}
4646

47-
if opts.config.offline() {
48-
match opts.precise {
49-
None => {
50-
anyhow::bail!("you can't update in the offline mode without precise packages");
51-
}
52-
Some(_) => {}
53-
}
47+
if opts.config.offline() && opts.precise.is_none() {
48+
anyhow::bail!("you can't update in the offline mode without precise packages");
5449
}
5550

5651
// Updates often require a lot of modifications to the registry, so ensure

0 commit comments

Comments
 (0)