Skip to content

Commit

Permalink
Improve naming of tuple getters, and add mutable tuple getter
Browse files Browse the repository at this point in the history
Renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters.
  • Loading branch information
brendanzab committed Feb 16, 2014
1 parent 2cd7a29 commit cf0654c
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 133 deletions.
8 changes: 4 additions & 4 deletions src/libcollections/btree.rs
Expand Up @@ -500,15 +500,15 @@ impl<K: Clone + TotalOrd, V: Clone> Branch<K, V> {
let new_outcome = self.clone().rightmost_child.insert(k.clone(),
v.clone(),
ub.clone());
new_branch = new_outcome.clone().n0();
outcome = new_outcome.n1();
new_branch = new_outcome.clone().val0();
outcome = new_outcome.val1();
}
else {
let new_outcome = self.clone().elts[index.unwrap()].left.insert(k.clone(),
v.clone(),
ub.clone());
new_branch = new_outcome.clone().n0();
outcome = new_outcome.n1();
new_branch = new_outcome.clone().val0();
outcome = new_outcome.val1();
}
//Check to see whether a branch or a leaf was returned from the
//tree traversal.
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/render.rs
Expand Up @@ -1379,11 +1379,11 @@ fn render_methods(w: &mut Writer, it: &clean::Item) -> fmt::Result {
match c.impls.find(&it.id) {
Some(v) => {
let mut non_trait = v.iter().filter(|p| {
p.n0_ref().trait_.is_none()
p.ref0().trait_.is_none()
});
let non_trait = non_trait.to_owned_vec();
let mut traits = v.iter().filter(|p| {
p.n0_ref().trait_.is_some()
p.ref0().trait_.is_some()
});
let traits = traits.to_owned_vec();

Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/lib.rs
Expand Up @@ -262,7 +262,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
let mut pm = plugins::PluginManager::new(Path::new(path));
for pass in passes.iter() {
let plugin = match PASSES.iter().position(|&(p, _, _)| p == *pass) {
Some(i) => PASSES[i].n1(),
Some(i) => PASSES[i].val1(),
None => {
error!("unknown pass {}, skipping", *pass);
continue
Expand Down

0 comments on commit cf0654c

Please sign in to comment.