]> git.lizzy.rs Git - rust.git/commitdiff
Rust has type aliases, not typedefs.
authorSteven Allen <steven@stebalien.com>
Tue, 23 Aug 2016 14:47:28 +0000 (10:47 -0400)
committerSteven Allen <steven@stebalien.com>
Tue, 23 Aug 2016 14:49:11 +0000 (10:49 -0400)
They're the same thing but it's better to keep the terminology consistent.

src/libcollections/fmt.rs

index a1b4461949c6eef83119f684553190804fa3360e..beb3e6b3d4e3132bf87a012bd59935d1c691f583 100644 (file)
 //! 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: