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
Showing only changes of commit 23df792abf - Show all commits

View File

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