Skip to content

Commit

Permalink
Mark std::fmt::from_fn as #[must_use]
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamofek authored and gitbot committed Feb 20, 2025
1 parent 1ab8856 commit fa2c0cc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/fmt/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
/// assert_eq!(format!("{:?}", wrapped), "'a'");
/// ```
#[unstable(feature = "debug_closure_helpers", issue = "117729")]
#[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"]
pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
FromFn(f)
}
Expand Down

0 comments on commit fa2c0cc

Please sign in to comment.