]> git.proxmox.com Git - cargo.git/commitdiff
Writer::write → Writer::write_all
authorGabriel Souza Franco <gabrielfrancosouza@gmail.com>
Fri, 30 Jan 2015 14:38:21 +0000 (12:38 -0200)
committerGabriel Souza Franco <gabrielfrancosouza@gmail.com>
Fri, 30 Jan 2015 18:08:04 +0000 (16:08 -0200)
src/cargo/core/shell.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/sources/registry.rs
src/cargo/util/config.rs
tests/test_cargo_build_auth.rs

index b398619455b3e1a91a81287011688977464ce21d..c0a62baaf1e32b87e8274c5f6a499ca97b51d8ef 100644 (file)
@@ -171,10 +171,10 @@ impl Shell {
 }
 
 impl Writer for Shell {
-    fn write(&mut self, buf: &[u8]) -> IoResult<()> {
+    fn write_all(&mut self, buf: &[u8]) -> IoResult<()> {
         match self.terminal {
-            Colored(ref mut c) => c.write(buf),
-            NoColor(ref mut n) => n.write(buf)
+            Colored(ref mut c) => c.write_all(buf),
+            NoColor(ref mut n) => n.write_all(buf)
         }
     }
 
@@ -187,7 +187,7 @@ impl Writer for Shell {
 }
 
 impl Writer for UghWhyIsThisNecessary {
-    fn write(&mut self, bytes: &[u8]) -> IoResult<()> {
-        self.inner.write(bytes)
+    fn write_all(&mut self, bytes: &[u8]) -> IoResult<()> {
+        self.inner.write_all(bytes)
     }
 }
index 3126e408300ddd948e4be2433338558bed6389b2..85ab012c7b69ffb4aac9d4a0c7daf63178064e85 100644 (file)
@@ -80,11 +80,11 @@ fn mk(config: &Config, path: &Path, name: &str,
     match vcs {
         VersionControl::Git => {
             try!(GitRepo::init(path));
-            try!(File::create(&path.join(".gitignore")).write(ignore.as_bytes()));
+            try!(File::create(&path.join(".gitignore")).write_all(ignore.as_bytes()));
         },
         VersionControl::Hg => {
             try!(HgRepo::init(path));
-            try!(File::create(&path.join(".hgignore")).write(ignore.as_bytes()));
+            try!(File::create(&path.join(".hgignore")).write_all(ignore.as_bytes()));
         },
         VersionControl::NoVcs => {
             try!(fs::mkdir(path, old_io::USER_RWX));
index f94316f29e43981d04bf478932451f856bdcc107..96d8ed99de9cb248899dae411e5d8ee96aad3fc5 100644 (file)
@@ -409,8 +409,8 @@ pub fn append_current_dir(path: &Path, cwd: &Path) -> CargoResult<()> {
     let mut f = try!(File::open_mode(path, old_io::Open, old_io::ReadWrite));
     let contents = try!(f.read_to_end());
     try!(f.seek(0, old_io::SeekSet));
-    try!(f.write(cwd.as_vec()));
-    try!(f.write(&[0]));
-    try!(f.write(&contents[]));
+    try!(f.write_all(cwd.as_vec()));
+    try!(f.write_all(&[0]));
+    try!(f.write_all(&contents[]));
     Ok(())
 }
index f17aaf772aa414e02c75d3a2b62267bb772711b5..ef41471cd0d997c2ac2f0750536497b3e462c9cf 100644 (file)
@@ -333,7 +333,7 @@ impl<'a, 'b> RegistrySource<'a, 'b> {
                                      pkg)))
         }
 
-        try!(File::create(&dst).write(resp.get_body()));
+        try!(File::create(&dst).write_all(resp.get_body()));
         Ok(dst)
     }
 
index 5393ca9091c308a488ab481827513e89c813d2b4..5f58001400435daa0fad408c2bab9f6e23c94063 100644 (file)
@@ -436,6 +436,6 @@ pub fn set_config(cfg: &Config, loc: Location, key: &str,
     let contents = File::open(&file).read_to_string().unwrap_or("".to_string());
     let mut toml = try!(cargo_toml::parse(contents.as_slice(), &file));
     toml.insert(key.to_string(), value.into_toml());
-    try!(File::create(&file).write(toml::Value::Table(toml).to_string().as_bytes()));
+    try!(File::create(&file).write_all(toml::Value::Table(toml).to_string().as_bytes()));
     Ok(())
 }
index 08592b77ac7548a05fd20f571f3a5ef855a4b32a..646db4fd8824738244785ba8f2c5ac6b497640b1 100644 (file)
@@ -41,7 +41,7 @@ test!(http_auth_offered {
     let t = Thread::scoped(move|| {
         let mut s = BufferedStream::new(a.accept().unwrap());
         let req = headers(&mut s);
-        s.write(b"\
+        s.write_all(b"\
             HTTP/1.1 401 Unauthorized\r\n\
             WWW-Authenticate: Basic realm=\"wheee\"\r\n
             \r\n\
@@ -55,7 +55,7 @@ test!(http_auth_offered {
 
         let mut s = BufferedStream::new(a.accept().unwrap());
         let req = headers(&mut s);
-        s.write(b"\
+        s.write_all(b"\
             HTTP/1.1 401 Unauthorized\r\n\
             WWW-Authenticate: Basic realm=\"wheee\"\r\n
             \r\n\