Accept an Option<&str> as a link name #14
|
@ -18,10 +18,14 @@ impl Builder {
|
|||
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 {
|
||||
to: to.into(),
|
||||
name: name,
|
||||
name: name.map(Into::into),
|
||||
});
|
||||
self
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue