Skip to content

Commit 065fa9a

Browse files
committed
Make cargo a little more ideomatic
1 parent 11a56c3 commit 065fa9a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/cargo/cargo.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ fn load_source_info(c: cargo, src: source) {
557557
if !os::path_exists(srcfile) { ret; }
558558
let srcstr = io::read_whole_file_str(srcfile);
559559
alt json::from_str(result::get(srcstr)) {
560-
ok(json::dict(_s)) {
561-
let o = parse_source(src.name, json::dict(_s));
560+
ok(json::dict(s)) {
561+
let o = parse_source(src.name, json::dict(s));
562562

563563
src.key = o.key;
564564
src.keyfp = o.keyfp;
@@ -635,7 +635,7 @@ fn build_cargo_options(argv: [str]) -> options {
635635

636636
fn configure(opts: options) -> cargo {
637637
let home = alt get_cargo_root() {
638-
ok(_home) { _home }
638+
ok(home) { home }
639639
err(_err) { result::get(get_cargo_sysroot()) }
640640
};
641641

@@ -647,11 +647,11 @@ fn configure(opts: options) -> cargo {
647647

648648
let p = result::get(get_cargo_dir());
649649

650-
let sources = map::str_hash::<source>();
650+
let sources = map::str_hash();
651651
try_parse_sources(path::connect(home, "sources.json"), sources);
652652
try_parse_sources(path::connect(home, "local-sources.json"), sources);
653653

654-
let dep_cache = map::str_hash::<bool>();
654+
let dep_cache = map::str_hash();
655655

656656
let mut c = {
657657
pgp: pgp::supported(),
@@ -799,7 +799,7 @@ fn install_source(c: cargo, path: str) {
799799

800800
let wd_base = c.workdir + path::path_sep();
801801
let wd = alt tempfile::mkdtemp(wd_base, "") {
802-
some(_wd) { _wd }
802+
some(wd) { wd }
803803
none { fail #fmt("needed temp dir: %s", wd_base); }
804804
};
805805

@@ -819,8 +819,8 @@ fn install_source(c: cargo, path: str) {
819819

820820
fn install_git(c: cargo, wd: str, url: str, ref: option<str>) {
821821
run::program_output("git", ["clone", url, wd]);
822-
if option::is_some::<str>(ref) {
823-
let r = option::get::<str>(ref);
822+
if option::is_some(ref) {
823+
let r = option::get(ref);
824824
os::change_dir(wd);
825825
run::run_program("git", ["checkout", r]);
826826
}
@@ -1021,8 +1021,8 @@ fn cmd_uninstall(c: cargo) {
10211021

10221022
fn install_query(c: cargo, wd: str, target: str) {
10231023
alt c.dep_cache.find(target) {
1024-
some(_inst) {
1025-
if _inst {
1024+
some(inst) {
1025+
if inst {
10261026
ret;
10271027
}
10281028
}
@@ -1082,7 +1082,7 @@ fn install_query(c: cargo, wd: str, target: str) {
10821082
fn cmd_install(c: cargo) unsafe {
10831083
let wd_base = c.workdir + path::path_sep();
10841084
let wd = alt tempfile::mkdtemp(wd_base, "") {
1085-
some(_wd) { _wd }
1085+
some(wd) { wd }
10861086
none { fail #fmt("needed temp dir: %s", wd_base); }
10871087
};
10881088

0 commit comments

Comments
 (0)