-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to continue if an Error occurs in one section #128
Conversation
f458ec6
to
c36b02b
Compare
|
||
let git_config = instructions.git(); | ||
|
||
let add_entries = || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand why this add_entries
doesn't need to be mut
like all the others. For example, if I remove the mut
from add_entries
in configure_build
, the compiler says
cargo check --features build
Checking vergen v7.3.2 (/home/nora/Projects/vergen) i
error[E0596]: cannot borrow `add_entries` as mutable, as it is not declared as mutable
--> src/feature/build.rs:150:26
|
124 | let add_entries = || {
| ----------- help: consider changing this to be mutable: `mut add_entries`
...
128 | add_config_entries(config, *build_config, &OffsetDateTime::now_utc())?;
| ------ calling `add_entries` requires mutable binding due to mutable borrow of `config`
...
150 | let result = add_entries();
| ^^^^^^^^^^^ cannot borrow as mutable
(... analogous reports snipped ...)
but config
is borrowed here in the same way as there 🤔? Any advice appreciated 😄
Anyway, this compiles and seems to do the right thing 🤷
Hey, could you please approve the CI run? I'm a first-time contributor to this project, so GitHub prevents me from running CI (and rightly so) :) |
Sorry was on vacation last week. It's running now. |
- This test needs a directory that is not a git repository or a subdirectory of a git repository. - Use a temporary directory, provided by the tempfile crate. - The tempfile dependency is only needed for this one test. It is only compiled in the test configuration and if the git feature is active. Sadly, there is no way to define optional dev-dependencies[0], so deactivate the unused_crate_dependencies lint to allow compilation of the other features. [0]: rust-lang/cargo#1596
If the "git" feature is not active, no git2 Errors will be generated.
c36b02b
to
7dc4d81
Compare
Thank you :) No problem, I hope the vacation was nice 🍹 I messed up formatting, sorry 😓 |
That's why the check is there :). I miss formatting all the time. |
Codecov Report
@@ Coverage Diff @@
## master #128 +/- ##
==========================================
- Coverage 94.57% 93.86% -0.71%
==========================================
Files 11 11
Lines 1105 1189 +84
==========================================
+ Hits 1045 1116 +71
- Misses 60 73 +13
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Thanks for merging :) 🎉 |
Closes #124
What has been done:
skip_if_error
to thebuild
,git
,rustc
andsysinfo
features, to allow skipping a feature and continuing if an Error occurs.configure_cargo
is not fallible, so the option wouldn't make sense there.cargo:warning
if an Error was skipped in this way.skip_if_error
for thegit
feature. This adds a new dependencytempfile
, which is just needed for this one test of thegit
feature. Sadly, there is no way to define optional dev-dependencies (Allow optional dev-dependencies rust-lang/cargo#1596), so I deactivated theunused_crate_dependencies
lint.option_env!
.Open questions:
skip_if_error
is a good name, please suggest a better one :)unused_crate_dependencies
okay for you?