libgraphviz: add label and escaped ctors taking any str::IntoMaybeOwned.

This commit is contained in:
Felix S. Klock II 2014-12-15 12:32:54 +01:00
parent 1b97cd338b
commit c500b63e71

@ -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