@@ -27,9 +27,9 @@ pub trait Buffer {
2727 /// let mut state = FormatState::new(SimpleFormatContext::default());
2828 /// let mut buffer = VecBuffer::new(&mut state);
2929 ///
30- /// buffer.write_element(FormatElement::StaticText { text: "test"}).unwrap();
30+ /// buffer.write_element(FormatElement::Token { text: "test"}).unwrap();
3131 ///
32- /// assert_eq!(buffer.into_vec(), vec![FormatElement::StaticText { text: "test" }]);
32+ /// assert_eq!(buffer.into_vec(), vec![FormatElement::Token { text: "test" }]);
3333 /// ```
3434 ///
3535 fn write_element ( & mut self , element : FormatElement ) -> FormatResult < ( ) > ;
@@ -53,9 +53,9 @@ pub trait Buffer {
5353 /// let mut state = FormatState::new(SimpleFormatContext::default());
5454 /// let mut buffer = VecBuffer::new(&mut state);
5555 ///
56- /// buffer.write_fmt(format_args!(text ("Hello World"))).unwrap();
56+ /// buffer.write_fmt(format_args!(token ("Hello World"))).unwrap();
5757 ///
58- /// assert_eq!(buffer.into_vec(), vec![FormatElement::StaticText { text: "Hello World" }]);
58+ /// assert_eq!(buffer.into_vec(), vec![FormatElement::Token { text: "Hello World" }]);
5959 /// ```
6060 fn write_fmt ( mut self : & mut Self , arguments : Arguments < Self :: Context > ) -> FormatResult < ( ) > {
6161 write ( & mut self , arguments)
@@ -269,7 +269,7 @@ Make sure that you take and restore the snapshot in order and that this snapshot
269269///
270270/// impl Format<SimpleFormatContext> for Preamble {
271271/// fn fmt(&self, f: &mut Formatter<SimpleFormatContext>) -> FormatResult<()> {
272- /// write!(f, [text ("# heading"), hard_line_break()])
272+ /// write!(f, [token ("# heading"), hard_line_break()])
273273/// }
274274/// }
275275///
@@ -280,7 +280,7 @@ Make sure that you take and restore the snapshot in order and that this snapshot
280280/// {
281281/// let mut with_preamble = PreambleBuffer::new(&mut buffer, Preamble);
282282///
283- /// write!(&mut with_preamble, [text ("this text will be on a new line")])?;
283+ /// write!(&mut with_preamble, [token ("this text will be on a new line")])?;
284284/// }
285285///
286286/// let formatted = Formatted::new(Document::from(buffer.into_vec()), SimpleFormatContext::default());
@@ -300,7 +300,7 @@ Make sure that you take and restore the snapshot in order and that this snapshot
300300///
301301/// impl Format<SimpleFormatContext> for Preamble {
302302/// fn fmt(&self, f: &mut Formatter<SimpleFormatContext>) -> FormatResult<()> {
303- /// write!(f, [text ("# heading"), hard_line_break()])
303+ /// write!(f, [token ("# heading"), hard_line_break()])
304304/// }
305305/// }
306306///
@@ -455,11 +455,11 @@ where
455455/// write!(
456456/// buffer,
457457/// [
458- /// text ("The next soft line or space gets replaced by a space"),
458+ /// token ("The next soft line or space gets replaced by a space"),
459459/// soft_line_break_or_space(),
460- /// text ("and the line here"),
460+ /// token ("and the line here"),
461461/// soft_line_break(),
462- /// text ("is removed entirely.")
462+ /// token ("is removed entirely.")
463463/// ]
464464/// )
465465/// })]
@@ -468,10 +468,10 @@ where
468468/// assert_eq!(
469469/// formatted.document().as_ref(),
470470/// &[
471- /// FormatElement::StaticText { text: "The next soft line or space gets replaced by a space" },
471+ /// FormatElement::Token { text: "The next soft line or space gets replaced by a space" },
472472/// FormatElement::Space,
473- /// FormatElement::StaticText { text: "and the line here" },
474- /// FormatElement::StaticText { text: "is removed entirely." }
473+ /// FormatElement::Token { text: "and the line here" },
474+ /// FormatElement::Token { text: "is removed entirely." }
475475/// ]
476476/// );
477477///
@@ -706,19 +706,19 @@ pub trait BufferExtensions: Buffer + Sized {
706706 /// let formatted = format!(SimpleFormatContext::default(), [format_with(|f| {
707707 /// let mut recording = f.start_recording();
708708 ///
709- /// write!(recording, [text ("A")])?;
710- /// write!(recording, [text ("B")])?;
709+ /// write!(recording, [token ("A")])?;
710+ /// write!(recording, [token ("B")])?;
711711 ///
712- /// write!(recording, [format_with(|f| write!(f, [text ("C"), text ("D")]))])?;
712+ /// write!(recording, [format_with(|f| write!(f, [token ("C"), token ("D")]))])?;
713713 ///
714714 /// let recorded = recording.stop();
715715 /// assert_eq!(
716716 /// recorded.deref(),
717717 /// &[
718- /// FormatElement::StaticText { text: "A" },
719- /// FormatElement::StaticText { text: "B" },
720- /// FormatElement::StaticText { text: "C" },
721- /// FormatElement::StaticText { text: "D" }
718+ /// FormatElement::Token { text: "A" },
719+ /// FormatElement::Token { text: "B" },
720+ /// FormatElement::Token { text: "C" },
721+ /// FormatElement::Token { text: "D" }
722722 /// ]
723723 /// );
724724 ///
0 commit comments