]> git.lizzy.rs Git - rust.git/commitdiff
Fix issue with tests
authorAdolfo Ochagavía <aochagavia92@gmail.com>
Sat, 28 Jun 2014 15:27:29 +0000 (17:27 +0200)
committerAdolfo Ochagavía <aochagavia92@gmail.com>
Mon, 30 Jun 2014 19:35:49 +0000 (21:35 +0200)
src/test/run-pass/issue-2804.rs

index beba39602dedba6298e2fddbe662b381141b765f..a0a800e08906dc134f9a597873f80c851b03ca00 100644 (file)
@@ -22,11 +22,11 @@ enum object {
     int_value(i64),
 }
 
-fn lookup(table: Box<json::Object>, key: String, default: String) -> String
+fn lookup(table: json::Object, key: String, default: String) -> String
 {
     match table.find(&key.to_string()) {
         option::Some(&json::String(ref s)) => {
-            (*s).to_string()
+            s.to_string()
         }
         option::Some(value) => {
             println!("{} was expected to be a string but is a {:?}", key, value);
@@ -42,7 +42,7 @@ fn add_interface(_store: int, managed_ip: String, data: json::Json) -> (String,
 {
     match &data {
         &json::Object(ref interface) => {
-            let name = lookup((*interface).clone(),
+            let name = lookup(interface.clone(),
                               "ifDescr".to_string(),
                               "".to_string());
             let label = format!("{}-{}", managed_ip, name);