]> git.proxmox.com Git - cargo.git/commitdiff
Fix warnings
authorCarl Lerche <me@carllerche.com>
Mon, 17 Mar 2014 19:03:37 +0000 (12:03 -0700)
committerCarl Lerche <me@carllerche.com>
Mon, 17 Mar 2014 19:03:37 +0000 (12:03 -0700)
src/bin/cargo-read-manifest.rs
src/bin/cargo-rustc.rs
src/bin/cargo-verify-project.rs

index c4f12cdae4f1cd71944adaac6f720e45207ae55b..19bb390877594d39a85cdfe75ec972d9571bba28 100644 (file)
@@ -4,13 +4,11 @@ extern crate cargo;
 extern crate hammer;
 extern crate serialize;
 extern crate toml;
-extern crate semver;
 
 use hammer::{FlagDecoder,FlagConfig,FlagConfiguration};
 use serialize::{Decoder,Decodable};
 use serialize::json::Encoder;
 use toml::from_toml;
-use semver::Version;
 use cargo::{Manifest,LibTarget,ExecTarget,Project};
 use std::path::Path;
 
@@ -78,7 +76,7 @@ fn normalize(lib: &Option<~[SerializedLibTarget]>, bin: &Option<~[SerializedExec
     }
 
     let b = bin.get_ref().map(|b_ref| {
-      let mut b = b_ref.clone();
+      let b = b_ref.clone();
       let mut path = b.path.clone();
       if path.is_none() {
         path = Some(format!("src/bin/{}.rs", b.name.clone()));
@@ -97,7 +95,7 @@ fn normalize(lib: &Option<~[SerializedLibTarget]>, bin: &Option<~[SerializedExec
     (~[LibTarget{ path: path.unwrap(), name: l.name }], ~[])
   } else if bin.is_some() {
     let b = bin.get_ref().map(|b_ref| {
-      let mut b = b_ref.clone();
+      let b = b_ref.clone();
       let mut path = b.path.clone();
       if path.is_none() {
         path = Some(format!("src/bin/{}.rs", b.name.clone()));
index 5b48a9859b72c50b46b013164f4f9488f3183a06..d006ba9668c69ac7c214dd8372a55f075a04aaa7 100644 (file)
@@ -8,9 +8,9 @@ use std::os::args;
 use std::io;
 use std::io::process::Process;
 use serialize::json;
-use serialize::{Decoder,Decodable};
+use serialize::Decodable;
 use std::path::Path;
-use cargo::{Manifest,LibTarget,ExecTarget,Project};
+use cargo::Manifest;
 
 /**
   cargo-rustc -- ...args
@@ -47,7 +47,10 @@ fn main() {
     ~"--crate-type", ~"lib"
   ];
 
-  io::fs::mkdir_recursive(&root.join("target"), io::UserRWX);
+  match io::fs::mkdir_recursive(&root.join("target"), io::UserRWX) {
+    Err(_) => fail!("Couldn't mkdir -p"),
+    Ok(val) => val
+  }
 
   println!("Executing {}", args);
 
index afc6d00ee92cce06e7533df92fae83f42e6dec7d..85b8a5e247495da7f59c21b0dec6d50334ec2f9f 100644 (file)
@@ -4,8 +4,7 @@ extern crate toml;
 extern crate getopts;
 
 use std::os::{args,set_exit_status};
-use std::io::process::Process;
-use getopts::{reqopt,getopts,OptGroup};
+use getopts::{reqopt,getopts};
 
 /**
   cargo-verify-project --manifest=LOCATION
@@ -20,7 +19,7 @@ fn main() {
 
   let matches = match getopts(arguments.tail(), opts) {
     Ok(m) => m,
-    Err(err) => {
+    Err(_) => {
       fail("missing-argument", "manifest");
       return;
     }
@@ -39,8 +38,8 @@ fn main() {
     return;
   }
 
-  let root = match toml::parse_from_file(file.as_str().unwrap()) {
-    Err(e) => {
+  match toml::parse_from_file(file.as_str().unwrap()) {
+    Err(_) => {
       fail("invalid", "invalid-format");
       return;
     },