Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Commit cd90861

Browse files
committed
Merge pull request #142 from bgamari/master
Nightly fallout
2 parents e9d9631 + 3b0eb9a commit cd90861

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

ioreg/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ impl<'a, 'b> Parser<'a, 'b> {
471471
self.bump();
472472
// for some reason ident begins with '/// '
473473
let s = token::get_ident(docstring.ident());
474-
let stripped = s.get().trim_left_chars(&['/',' ']);
474+
let stripped = s.get().trim_left_chars(['/',' '].as_slice());
475475
docs.push(String::from_str(stripped));
476476
},
477477
_ => break,

platformtree/builder/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn build_args(builder: &mut Builder, cx: &mut ExtCtxt,
102102
all_keys.sort();
103103

104104
for k in all_keys.iter() {
105-
let v = node_attr.get(k);
105+
let v = &(*node_attr)[*k];
106106

107107
let (ty, val) = match v.value {
108108
node::IntValue(i) =>

platformtree/node.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ impl Node {
261261

262262
/// Returns attribute by name or fail!()s.
263263
pub fn get_attr(&self, key: &str) -> Rc<Attribute> {
264-
self.attributes.borrow().get(&key.to_string()).clone()
264+
let ref attr = (*self.attributes.borrow())[key.to_string()];
265+
attr.clone()
265266
}
266267

267268
/// Returns a string attribute by name or None, if it's not present or not of

platformtree/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl<'a> Parser<'a> {
7878
failed = true;
7979
self.sess.span_diagnostic.span_err(node.path_span,
8080
format!("duplicate node definition `{}`", path).as_slice());
81-
let old_node: &Rc<node::Node> = nodes.get(&path);
81+
let old_node: &Rc<node::Node> = &nodes[path];
8282
self.sess.span_diagnostic.span_err(old_node.path_span,
8383
"previously defined here");
8484
} else {
@@ -120,7 +120,7 @@ impl<'a> Parser<'a> {
120120
"duplicate `{}` definition", name).as_slice());
121121

122122
self.sess.span_diagnostic.span_warn(
123-
map.get(name).upgrade().unwrap().name_span,
123+
(*map)[*name].upgrade().unwrap().name_span,
124124
"previously defined here");
125125
return false;
126126
} else {
@@ -316,7 +316,7 @@ impl<'a> Parser<'a> {
316316
self.span = node.path_span;
317317
self.error(format!("duplicate node definition `{}`",
318318
path));
319-
let old_node: Rc<node::Node> = subnodes.as_map().get(&path).upgrade().unwrap();
319+
let old_node: Rc<node::Node> = subnodes.as_map()[path].upgrade().unwrap();
320320
self.span = old_node.path_span.clone();
321321
self.error("previously defined here".to_string());
322322
return None;

src/hal/lpc17xx/pin_pt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fn build_pin(builder: &mut Builder, cx: &mut ExtCtxt, node: Rc<node::Node>) {
8888
let function_str = match node.get_string_attr("function") {
8989
None => "GPIO".to_string(),
9090
Some(fun) => {
91-
let pins = port_def.get(port_path);
91+
let pins = &port_def[*port_path];
9292
let maybe_pin_index = from_str(node.path.as_slice()).unwrap();
9393
match pins[maybe_pin_index] {
9494
None => {

0 commit comments

Comments
 (0)