diff --git a/src/lib.rs b/src/lib.rs index f4de79c50..3cd572153 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2319,6 +2319,8 @@ pub trait Itertools: Iterator { /// with `sep` inserted between each element. /// /// **Panics** if the formatter helper is formatted more than once. + /// ⚠ This can happen unexpectedly and be hard to debug if used in + /// _macros of some logging frameworks_ like `tracing`! ⚠ /// /// ``` /// use itertools::Itertools; @@ -2339,6 +2341,10 @@ pub trait Itertools: Iterator { /// /// This is a customizable version of [`.format()`](Itertools::format). /// + /// **Panics** if the formatter helper is formatted more than once. + /// ⚠ This can happen unexpectedly and be hard to debug if used in + /// _macros of some logging frameworks_ like `tracing`! ⚠ + /// /// The supplied closure `format` is called once per iterator element, /// with two arguments: the element and a callback that takes a /// `&Display` value, i.e. any reference to type that implements `Display`. @@ -2346,8 +2352,6 @@ pub trait Itertools: Iterator { /// Using `&format_args!(...)` is the most versatile way to apply custom /// element formatting. The callback can be called multiple times if needed. /// - /// **Panics** if the formatter helper is formatted more than once. - /// /// ``` /// use itertools::Itertools; ///