Skip to content

Commit e10ab62

Browse files
committed
Link “? operator” to relevant chapter in The Book
Before, the text simply asked people to use a symbol which is hard to search for. Now the text links back to the chapter on error propagation in The Book. That should help people find the relevant keywords for further searches.
1 parent 7f442f8 commit e10ab62

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/core/src/macros/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,12 @@ macro_rules! matches {
350350

351351
/// Unwraps a result or propagates its error.
352352
///
353-
/// The `?` operator was added to replace `try!` and should be used instead.
354-
/// Furthermore, `try` is a reserved word in Rust 2018, so if you must use
355-
/// it, you will need to use the [raw-identifier syntax][ris]: `r#try`.
353+
/// The [`?` operator][propagating-errors] was added to replace `try!`
354+
/// and should be used instead. Furthermore, `try` is a reserved word
355+
/// in Rust 2018, so if you must use it, you will need to use the
356+
/// [raw-identifier syntax][ris]: `r#try`.
356357
///
358+
/// [propagating-errors]: https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator
357359
/// [ris]: https://doc.rust-lang.org/nightly/rust-by-example/compatibility/raw_identifiers.html
358360
///
359361
/// `try!` matches the given [`Result`]. In case of the `Ok` variant, the

0 commit comments

Comments
 (0)