Skip to content

Commit 3136c54

Browse files
committed
context directly on error instead of Err variant
1 parent 3ccb17c commit 3136c54

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/cargo/core/registry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ impl<'gctx> PackageRegistry<'gctx> {
444444
patches must point to different sources",
445445
dep.package_name(),
446446
url
447-
))
448-
.context(format!("failed to resolve patches for `{}`", url));
447+
)
448+
.context(format!("failed to resolve patches for `{}`", url)));
449449
}
450450
unlocked_summaries.push(summary);
451451
}

src/cargo/sources/git/oxide.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ fn amend_authentication_hints(
206206
"if a proxy or similar is necessary `net.git-fetch-with-cli` may help here\n",
207207
"https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli"
208208
);
209-
return Err(anyhow::Error::from(err)).context(msg);
209+
return Err(anyhow::Error::from(err).context(msg));
210210
}
211211
_ => None,
212212
};
@@ -225,7 +225,7 @@ fn amend_authentication_hints(
225225
msg.push_str(
226226
"https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli",
227227
);
228-
return Err(anyhow::Error::from(err)).context(msg);
228+
return Err(anyhow::Error::from(err).context(msg));
229229
}
230230
}
231231
Err(err.into())

0 commit comments

Comments
 (0)