diff options
author | seancarroll <seanc28@gmail.com> | 2021-03-23 23:22:09 -0500 |
---|---|---|
committer | seancarroll <seanc28@gmail.com> | 2021-03-23 23:22:09 -0500 |
commit | 889162257cda19bafd4ff344cb878565f2562794 (patch) | |
tree | 4a322537d9092637b8eeb510122db02a2936f148 /src/attributes | |
parent | 2f7ecf77781f181b8de178e0ec2f4a37a958a412 (diff) | |
download | dotavious-889162257cda19bafd4ff344cb878565f2562794.zip |
support Into<String> in more scenarios to remove the need for users to always have to perform a .to_string
Diffstat (limited to 'src/attributes')
-rw-r--r-- | src/attributes/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/attributes/mod.rs b/src/attributes/mod.rs index 0cdfa99..94ade1b 100644 --- a/src/attributes/mod.rs +++ b/src/attributes/mod.rs @@ -495,7 +495,7 @@ pub trait GraphAttributes<'a> { } /// An escString or an HTML label. - fn label(&mut self, label: String) -> &mut Self { + fn label<S: Into<String>>(&mut self, label: S) -> &mut Self { Attributes::label(self.get_attributes_mut(), label); self } @@ -1047,8 +1047,8 @@ impl Attributes { ) } - pub fn label(attributes: &mut IndexMap<String, AttributeText>, text: String) { - Self::add_attribute(attributes, "label", AttributeText::quoted(text)); + pub fn label<S: Into<String>>(attributes: &mut IndexMap<String, AttributeText>, text: S) { + Self::add_attribute(attributes, "label", AttributeText::quoted(text.into())); } pub fn label_location( |