Skip to content

Commit 439664c

Browse files
committed
Auto merge of #102331 - notriddle:rollup-dmefd2d, r=notriddle
Rollup of 6 pull requests Successful merges: - #102283 (Improve code example for Option::unwrap_or_default) - #102319 (rustdoc: merge CSS `table` rules into `.docblock`) - #102321 ( Rustdoc-Json: List impls for primitives) - #102322 (Document that Display automatically implements ToString) - #102325 (rustdoc: give `.line-number` / `.line-numbers` meaningful names) - #102326 (rustdoc: Update doc comment for splitn_mut to include mutable in the …) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ba23db0 + 20ea35e commit 439664c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/src/fmt/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,12 +709,19 @@ pub use macros::Debug;
709709

710710
/// Format trait for an empty format, `{}`.
711711
///
712+
/// Implementing this trait for a type will automatically implement the
713+
/// [`ToString`][tostring] trait for the type, allowing the usage
714+
/// of the [`.to_string()`][tostring_function] method. Prefer implementing
715+
/// the `Display` trait for a type, rather than [`ToString`][tostring].
716+
///
712717
/// `Display` is similar to [`Debug`], but `Display` is for user-facing
713718
/// output, and so cannot be derived.
714719
///
715720
/// For more information on formatters, see [the module-level documentation][module].
716721
///
717722
/// [module]: ../../std/fmt/index.html
723+
/// [tostring]: ../../std/string/trait.ToString.html
724+
/// [tostring_function]: ../../std/string/trait.ToString.html#tymethod.to_string
718725
///
719726
/// # Examples
720727
///

core/src/slice/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ impl<T> [T] {
20762076
SplitN::new(self.split(pred), n)
20772077
}
20782078

2079-
/// Returns an iterator over subslices separated by elements that match
2079+
/// Returns an iterator over mutable subslices separated by elements that match
20802080
/// `pred`, limited to returning at most `n` items. The matched element is
20812081
/// not contained in the subslices.
20822082
///

0 commit comments

Comments
 (0)