Skip to content

Commit ee8a01f

Browse files
committed
Switching documentation to be more clear about potential errors
1 parent 0436067 commit ee8a01f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

library/core/src/fmt/mod.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,9 @@ pub trait Write {
119119
///
120120
/// This function will return an instance of [`Error`] on error.
121121
///
122-
/// Though it is possible for implementors of this trait to return an error, at the time
123-
/// of writing these docs, no implementation of [`std::fmt::Write`] in the standard library
124-
/// returns such an error.
125-
///
126-
/// When working with external crates, it is advised to check the implementation of this
127-
/// trait and anticipate any possible [`Error`]s.
122+
/// The purpose of std::fmt::Error is to abort the formatting operation when the underlying
123+
/// destination encounters some error preventing it from accepting more text; it should
124+
/// generally be propagated rather than handled, at least when implementing formatting traits.
128125
///
129126
/// # Examples
130127
///

0 commit comments

Comments
 (0)