1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 21:17:46 +00:00

Fix deprecation warnings

This commit is contained in:
Michael Gehring 2014-11-08 07:45:33 +01:00
parent ee9d30673e
commit e7b247de0b
4 changed files with 11 additions and 11 deletions

View file

@ -222,7 +222,7 @@ fn tail_lines<T: Reader>(reader: &mut BufferedReader<T>, mut line_count: uint, b
if line_count <= ringbuf.len() { if line_count <= ringbuf.len() {
ringbuf.pop_front(); ringbuf.pop_front();
} }
ringbuf.push(line); ringbuf.push_back(line);
} }
Err(err) => panic!(err) Err(err) => panic!(err)
} }
@ -250,7 +250,7 @@ fn tail_bytes<T: Reader>(reader: &mut BufferedReader<T>, mut byte_count: uint, b
if byte_count <= ringbuf.len() { if byte_count <= ringbuf.len() {
ringbuf.pop_front(); ringbuf.pop_front();
} }
ringbuf.push(byte); ringbuf.push_back(byte);
} }
Err(err) => panic!(err) Err(err) => panic!(err)
} }

View file

@ -219,7 +219,7 @@ fn parse_expr_helper<'a>(hashmap: &HashMap<&'a [u8], Precedence>,
mut lhs: bool, mut lhs: bool,
min_prec: Precedence, min_prec: Precedence,
error: &mut bool) -> bool { error: &mut bool) -> bool {
let mut prec = *hashmap.find(&args[0]).unwrap_or_else(|| { let mut prec = *hashmap.get(&args[0]).unwrap_or_else(|| {
*error = true; *error = true;
&min_prec &min_prec
}); });
@ -228,7 +228,7 @@ fn parse_expr_helper<'a>(hashmap: &HashMap<&'a [u8], Precedence>,
*args = (*args).slice_from(1); *args = (*args).slice_from(1);
let mut rhs = dispatch(args, error); let mut rhs = dispatch(args, error);
while args.len() > 0 { while args.len() > 0 {
let subprec = *hashmap.find(&args[0]).unwrap_or_else(|| { let subprec = *hashmap.get(&args[0]).unwrap_or_else(|| {
*error = true; *error = true;
&min_prec &min_prec
}); });
@ -249,7 +249,7 @@ fn parse_expr_helper<'a>(hashmap: &HashMap<&'a [u8], Precedence>,
_ => unreachable!() _ => unreachable!()
}; };
if args.len() > 0 { if args.len() > 0 {
prec = *hashmap.find(&args[0]).unwrap_or_else(|| { prec = *hashmap.get(&args[0]).unwrap_or_else(|| {
*error = true; *error = true;
&min_prec &min_prec
}); });

View file

@ -123,7 +123,7 @@ fn tr(set1: &[char], set2: &[char]) {
for c in stdin().chars() { for c in stdin().chars() {
match c { match c {
Ok(inc) => { Ok(inc) => {
let trc = match map.find(&(inc as uint)) { let trc = match map.get(&(inc as uint)) {
Some(t) => *t, Some(t) => *t,
None => inc, None => inc,
}; };

View file

@ -126,7 +126,7 @@ impl Graph {
} }
fn has_edge(&self, from: &String, to: &String) -> bool { fn has_edge(&self, from: &String, to: &String) -> bool {
self.in_edges.find(to).unwrap().contains(from) self.in_edges.get(to).unwrap().contains(from)
} }
fn init_node(&mut self, n: &String) { fn init_node(&mut self, n: &String) {
@ -144,8 +144,8 @@ impl Graph {
} }
if !self.has_edge(from, to) { if !self.has_edge(from, to) {
self.in_edges.find_mut(to).unwrap().insert(from.clone()); self.in_edges.get_mut(to).unwrap().insert(from.clone());
self.out_edges.find_mut(from).unwrap().push(to.clone()); self.out_edges.get_mut(from).unwrap().push(to.clone());
} }
} }
@ -164,9 +164,9 @@ impl Graph {
self.result.push(n.clone()); self.result.push(n.clone());
let n_out_edges = self.out_edges.find_mut(&n).unwrap(); let n_out_edges = self.out_edges.get_mut(&n).unwrap();
for m in n_out_edges.iter() { for m in n_out_edges.iter() {
let m_in_edges = self.in_edges.find_mut(m).unwrap(); let m_in_edges = self.in_edges.get_mut(m).unwrap();
m_in_edges.remove(&n); m_in_edges.remove(&n);
// If m doesn't have other in-coming edges add it to start_nodes // If m doesn't have other in-coming edges add it to start_nodes