Accept an Option<&str> as a link name #14
|
@ -18,10 +18,14 @@ impl Builder {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn link<T: Into<String>>(mut self, to: T, name: Option<String>) -> Builder {
|
pub fn link<T, S>(mut self, to: T, name: Option<S>) -> Self
|
||||||
|
where
|
||||||
|
T: Into<String>,
|
||||||
|
S: Into<String>,
|
||||||
|
{
|
||||||
self.nodes.push(Node::Link {
|
self.nodes.push(Node::Link {
|
||||||
to: to.into(),
|
to: to.into(),
|
||||||
name: name,
|
name: name.map(Into::into),
|
||||||
});
|
});
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue