summaryrefslogtreecommitdiff
path: root/src/attributes/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/attributes/mod.rs')
-rw-r--r--src/attributes/mod.rs6
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(