about summary refs log tree commit diff
path: root/src/librustdoc/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/display.rs')
-rw-r--r--src/librustdoc/display.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/display.rs b/src/librustdoc/display.rs
index aa0fad26520..db868c5c9a8 100644
--- a/src/librustdoc/display.rs
+++ b/src/librustdoc/display.rs
@@ -10,7 +10,7 @@ pub(crate) trait Joined: IntoIterator {
     ///
     /// The performance of `joined` is slightly better than `format`, since it doesn't need to use a `Cell` to keep track of whether [`fmt`](Display::fmt)
     /// was already called (`joined`'s API doesn't allow it be called more than once).
-    fn joined(self, sep: &str, f: &mut Formatter<'_>) -> fmt::Result;
+    fn joined(self, sep: impl Display, f: &mut Formatter<'_>) -> fmt::Result;
 }
 
 impl<I, T> Joined for I
@@ -18,12 +18,12 @@ where
     I: IntoIterator<Item = T>,
     T: Display,
 {
-    fn joined(self, sep: &str, f: &mut Formatter<'_>) -> fmt::Result {
+    fn joined(self, sep: impl Display, f: &mut Formatter<'_>) -> fmt::Result {
         let mut iter = self.into_iter();
         let Some(first) = iter.next() else { return Ok(()) };
         first.fmt(f)?;
         for item in iter {
-            f.write_str(sep)?;
+            sep.fmt(f)?;
             item.fmt(f)?;
         }
         Ok(())