remove unused pub fn

This commit is contained in:
klensy 2023-11-13 14:43:53 +03:00
parent 38eecca62c
commit aff6c741d4
13 changed files with 4 additions and 196 deletions

View file

@ -522,33 +522,6 @@ impl<'a> LabelText<'a> {
HtmlStr(ref s) => format!("<{s}>"),
}
}
/// Decomposes content into string suitable for making EscStr that
/// yields same content as self. The result obeys the law
/// render(`lt`) == render(`EscStr(lt.pre_escaped_content())`) for
/// all `lt: LabelText`.
fn pre_escaped_content(self) -> Cow<'a, str> {
match self {
EscStr(s) => s,
LabelStr(s) => {
if s.contains('\\') {
s.escape_default().to_string().into()
} else {
s
}
}
HtmlStr(s) => s,
}
}
/// Puts `suffix` on a line below this label, with a blank line separator.
pub fn suffix_line(self, suffix: LabelText<'_>) -> LabelText<'static> {
let mut prefix = self.pre_escaped_content().into_owned();
let suffix = suffix.pre_escaped_content();
prefix.push_str(r"\n\n");
prefix.push_str(&suffix);
EscStr(prefix.into())
}
}
pub type Nodes<'a, N> = Cow<'a, [N]>;