Skip to content

Commit

Permalink
Rust has type aliases, not typedefs.
Browse files Browse the repository at this point in the history
They're the same thing but it's better to keep the terminology consistent.
  • Loading branch information
Stebalien committed Aug 23, 2016
1 parent f2655e2 commit c7d5f7e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/libcollections/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@
//! provides some helper methods.
//!
//! Additionally, the return value of this function is `fmt::Result` which is a
//! typedef to `Result<(), std::fmt::Error>`. Formatting implementations should
//! ensure that they propagate errors from the `Formatter` (e.g., when calling
//! `write!`) however, they should never return errors spuriously. That is, a
//! formatting implementation must and may only return an error if the passed-in
//! `Formatter` returns an error. This is because, contrary to what the function
//! signature might suggest, string formatting is an infallible operation.
//! This function only returns a result because writing to the underlying stream
//! might fail and it must provide a way to propagate the fact that an error has
//! occurred back up the stack.
//! type alias of `Result<(), std::fmt::Error>`. Formatting implementations
//! should ensure that they propagate errors from the `Formatter` (e.g., when
//! calling `write!`) however, they should never return errors spuriously. That
//! is, a formatting implementation must and may only return an error if the
//! passed-in `Formatter` returns an error. This is because, contrary to what
//! the function signature might suggest, string formatting is an infallible
//! operation. This function only returns a result because writing to the
//! underlying stream might fail and it must provide a way to propagate the fact
//! that an error has occurred back up the stack.
//!
//! An example of implementing the formatting traits would look
//! like:
Expand Down

0 comments on commit c7d5f7e

Please sign in to comment.