Accept an Option<&str> as a link name #14

Closed
Ghost wants to merge 1 commits from (deleted):link-name-str into main
1 changed files with 6 additions and 2 deletions

View File

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