}
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)
}
}
}
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)
}
}
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));
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(())
}
pkg)))
}
- try!(File::create(&dst).write(resp.get_body()));
+ try!(File::create(&dst).write_all(resp.get_body()));
Ok(dst)
}
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(())
}
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\
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\