diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 0fdea7abebf3..76080ece3d86 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -97,7 +97,7 @@ fn find_library_crate_aux( filesearch::search(filesearch, |path| { debug!("inspecting file %s", path.to_str()); let f: ~str = path.filename().get(); - if !(str::starts_with(f, prefix) && str::ends_with(f, suffix)) { + if !(f.starts_with(prefix) && f.ends_with(suffix)) { debug!("skipping %s, doesn't look like %s*%s", path.to_str(), prefix, suffix); option::None::<()> diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index f43fd7586490..f9f655d50218 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -133,7 +133,7 @@ pub fn raw_pat(p: @pat) -> @pat { pub fn check_exhaustive(cx: @MatchCheckCtxt, sp: span, pats: ~[@pat]) { assert(!pats.is_empty()); - let ext = match is_useful(cx, vec::map(pats, |p| ~[*p]), ~[wild()]) { + let ext = match is_useful(cx, &pats.map(|p| ~[*p]), ~[wild()]) { not_useful => { // This is good, wildcard pattern isn't reachable return; @@ -165,7 +165,7 @@ pub fn check_exhaustive(cx: @MatchCheckCtxt, sp: span, pats: ~[@pat]) { ty::ty_unboxed_vec(*) | ty::ty_evec(*) => { match *ctor { vec(n) => Some(@fmt!("vectors of length %u", n)), - _ => None + _ => None } } _ => None @@ -205,10 +205,10 @@ pub enum ctor { // Note: is_useful doesn't work on empty types, as the paper notes. // So it assumes that v is non-empty. -pub fn is_useful(cx: @MatchCheckCtxt, +m: matrix, +v: &[@pat]) -> useful { +pub fn is_useful(cx: @MatchCheckCtxt, m: &matrix, v: &[@pat]) -> useful { if m.len() == 0u { return useful_; } if m[0].len() == 0u { return not_useful; } - let real_pat = match vec::find(m, |r| r[0].id != 0) { + let real_pat = match m.find(|r| r[0].id != 0) { Some(r) => r[0], None => v[0] }; let left_ty = if real_pat.id == 0 { ty::mk_nil(cx.tcx) } @@ -264,7 +264,7 @@ pub fn is_useful(cx: @MatchCheckCtxt, +m: matrix, +v: &[@pat]) -> useful { } Some(ref ctor) => { match is_useful(cx, - vec::filter_map(m, |r| default(cx, r)), + &m.filter_mapped(|r| default(cx, *r)), v.tail()) { useful_ => useful(left_ty, (/*bad*/copy *ctor)), ref u => (/*bad*/copy *u) @@ -280,7 +280,7 @@ pub fn is_useful(cx: @MatchCheckCtxt, +m: matrix, +v: &[@pat]) -> useful { } pub fn is_useful_specialized(cx: @MatchCheckCtxt, - m: matrix, + m: &matrix, v: &[@pat], +ctor: ctor, arity: uint, @@ -288,7 +288,7 @@ pub fn is_useful_specialized(cx: @MatchCheckCtxt, -> useful { let ms = m.filter_mapped(|r| specialize(cx, *r, ctor, arity, lty)); let could_be_useful = is_useful( - cx, ms, specialize(cx, v, ctor, arity, lty).get()); + cx, &ms, specialize(cx, v, ctor, arity, lty).get()); match could_be_useful { useful_ => useful(lty, ctor), ref u => (/*bad*/copy *u) @@ -347,7 +347,7 @@ pub fn is_wild(cx: @MatchCheckCtxt, p: @pat) -> bool { } pub fn missing_ctor(cx: @MatchCheckCtxt, - m: matrix, + m: &matrix, left_ty: ty::t) -> Option { match ty::get(left_ty).sty { diff --git a/src/librustc/middle/pat_util.rs b/src/librustc/middle/pat_util.rs index df9b9aa13746..77ad7df53197 100644 --- a/src/librustc/middle/pat_util.rs +++ b/src/librustc/middle/pat_util.rs @@ -26,7 +26,7 @@ pub fn pat_id_map(dm: resolve::DefMap, pat: @pat) -> PatIdMap { do pat_bindings(dm, pat) |_bm, p_id, _s, n| { map.insert(path_to_ident(n), p_id); }; - return map; + map } pub fn pat_is_variant_or_struct(dm: resolve::DefMap, pat: @pat) -> bool { diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 58316110b64e..83ef5a6f3a85 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -130,18 +130,18 @@ pub fn parse_config_( let args = args.tail(); let opts = vec::unzip(opts()).first(); match getopts::getopts(args, opts) { - result::Ok(matches) => { + Ok(matches) => { if matches.free.len() == 1 { - let input_crate = Path(copy *matches.free.head()); + let input_crate = Path(*matches.free.head()); config_from_opts(&input_crate, &matches, program_output) } else if matches.free.is_empty() { - result::Err(~"no crates specified") + Err(~"no crates specified") } else { - result::Err(~"multiple crates specified") + Err(~"multiple crates specified") } } - result::Err(f) => { - result::Err(getopts::fail_str(f)) + Err(f) => { + Err(getopts::fail_str(f)) } } }