Skip to content

Commit

Permalink
context directly on error instead of Err variant
Browse files Browse the repository at this point in the history
  • Loading branch information
mo8it committed Aug 9, 2024
1 parent 3ccb17c commit 3136c54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cargo/core/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ impl<'gctx> PackageRegistry<'gctx> {
patches must point to different sources",
dep.package_name(),
url
))
.context(format!("failed to resolve patches for `{}`", url));
)
.context(format!("failed to resolve patches for `{}`", url)));
}
unlocked_summaries.push(summary);
}
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/sources/git/oxide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn amend_authentication_hints(
"if a proxy or similar is necessary `net.git-fetch-with-cli` may help here\n",
"https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli"
);
return Err(anyhow::Error::from(err)).context(msg);
return Err(anyhow::Error::from(err).context(msg));
}
_ => None,
};
Expand All @@ -225,7 +225,7 @@ fn amend_authentication_hints(
msg.push_str(
"https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli",
);
return Err(anyhow::Error::from(err)).context(msg);
return Err(anyhow::Error::from(err).context(msg));
}
}
Err(err.into())
Expand Down

0 comments on commit 3136c54

Please sign in to comment.