libgraphviz: add label and escaped ctors taking any str::IntoMaybeOwned.
This commit is contained in:
parent
1b97cd338b
commit
c500b63e71
1 changed files with 8 additions and 0 deletions
|
|
@ -421,6 +421,14 @@ pub trait Labeller<'a,N,E> {
|
|||
}
|
||||
|
||||
impl<'a> LabelText<'a> {
|
||||
pub fn label<S:IntoCow<'a, String, str>>(s: S) -> LabelText<'a> {
|
||||
LabelStr(s.into_cow())
|
||||
}
|
||||
|
||||
pub fn escaped<S:IntoCow<'a, String, str>>(s: S) -> LabelText<'a> {
|
||||
EscStr(s.into_cow())
|
||||
}
|
||||
|
||||
fn escape_char<F>(c: char, mut f: F) where F: FnMut(char) {
|
||||
match c {
|
||||
// not escaping \\, since Graphviz escString needs to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue