Skip to content
Myr

Tweak readme's mention of bail

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent da3e403 · Browse files · 1 file+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−3 removed

  • other:+6 added−3 removed

1 file+6 added−3 removed

modified:README.md+6 added-3 removed
110 unmodified lines
111 }112 ```113114- One-off error messages can be constructed using the `anyhow!` macro, which115 supports string interpolation and produces an `anyhow::Error`. Use `bail!` as116 shorthand to return early with an error.115 supports string interpolation and produces an `anyhow::Error`.116117 ```rust118 return Err(anyhow!("Missing attribute: {}", missing));120 // or119 ```120121 A `bail!` macro is provided as a shorthand for the same early return.122123 ```rust124 bail!("Missing attribute: {}", missing);125 ```126127<br>
55 unmodified lines