about summary refs log tree commit diff
path: root/src/libgraphviz
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-12-12 13:23:21 +1300
committerNick Cameron <ncameron@mozilla.com>2014-12-16 17:05:33 +1300
commit769aa0a7b378a7b71f5bcbec3485fe171ff4f3b9 (patch)
tree6c0039840b240cb1f9386ef687b9a63c6926d404 /src/libgraphviz
parent0669a432a2e09ad08886cb2138dbe9f5d681fb7f (diff)
downloadrust-769aa0a7b378a7b71f5bcbec3485fe171ff4f3b9.tar.gz
rust-769aa0a7b378a7b71f5bcbec3485fe171ff4f3b9.zip
Remove the double auto-ref on arrays/strings as receivers
Part of #18469

[breaking-change]

A receiver will only ever get a single auto-reference. Previously arrays and strings would get two, e.g., [T] would be auto-ref'ed to &&[T]. This is usually apparent when a trait is implemented for `&[T]` and has a method takes self by reference. The usual solution is to implement the trait for `[T]` (the DST form).
Diffstat (limited to 'src/libgraphviz')
-rw-r--r--src/libgraphviz/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs
index fa048346e99..e1c44e658f1 100644
--- a/src/libgraphviz/lib.rs
+++ b/src/libgraphviz/lib.rs
@@ -440,7 +440,7 @@ impl<'a> LabelText<'a> {
     /// Renders text as string suitable for a label in a .dot file.
     pub fn escape(&self) -> String {
         match self {
-            &LabelStr(ref s) => s.escape_default(),
+            &LabelStr(ref s) => (&**s).escape_default(),
             &EscStr(ref s) => LabelText::escape_str(s.as_slice()),
         }
     }
@@ -453,7 +453,7 @@ impl<'a> LabelText<'a> {
         match self {
             EscStr(s) => s,
             LabelStr(s) => if s.contains_char('\\') {
-                s.escape_default().into_cow()
+                (&*s).escape_default().into_cow()
             } else {
                 s
             },