-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Improve FromStr
example
#102569
Improve FromStr
example
#102569
Conversation
The `from_str` implementation from the example had an `unwrap` that would make it panic on invalid input strings. Instead of panicking, it nows returns an error to better reflect the intented behavior of the `FromStr` trait.
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
r? @scottmcm (rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#102439 (rustdoc: re-sugar more cross-crate trait bounds) - rust-lang#102569 (Improve `FromStr` example) - rust-lang#102597 (Avoid ICE in printing RPITIT type) - rust-lang#102607 (Improve documentation of `slice::{from_ptr_range, from_ptr_range_mut}`) - rust-lang#102613 (Fix ICE rust-lang#101739) - rust-lang#102615 (Cleanup some error code explanations) - rust-lang#102617 (`HirId` for `deferred_transmute_checks`) - rust-lang#102620 (Migrate `.stab` elements style to CSS variables) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The
from_str
implementation from the example had anunwrap
that would make it panic on invalid input strings. Instead of panicking, it nows returns an error to better reflect the intented behavior of theFromStr
trait.