diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-01-29 16:33:57 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-03 09:32:33 -0800 |
| commit | ece8a8f520697be50cbe543bebe065c5198dae4d (patch) | |
| tree | fa1bf049d3b5d781c8c56e0d0491a655ece485a2 /src/libstd/hash.rs | |
| parent | be4fc638092bf896c5c6c0672136b83b71e491ee (diff) | |
| download | rust-ece8a8f520697be50cbe543bebe065c5198dae4d.tar.gz rust-ece8a8f520697be50cbe543bebe065c5198dae4d.zip | |
std: Remove io::io_error
* All I/O now returns IoResult<T> = Result<T, IoError> * All formatting traits now return fmt::Result = IoResult<()> * The if_ok!() macro was added to libstd
Diffstat (limited to 'src/libstd/hash.rs')
| -rw-r--r-- | src/libstd/hash.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs index 1444f9b4129..4163d1e0c96 100644 --- a/src/libstd/hash.rs +++ b/src/libstd/hash.rs @@ -27,13 +27,14 @@ #[allow(missing_doc)]; use container::Container; +use io::{Writer, IoResult}; use iter::Iterator; +use num::ToStrRadix; use option::{Some, None}; -use io::Writer; +use result::Ok; use str::OwnedStr; use to_bytes::IterBytes; use vec::ImmutableVector; -use num::ToStrRadix; // Alias `SipState` to `State`. pub use State = hash::SipState; @@ -164,7 +165,7 @@ macro_rules! compress ( impl Writer for SipState { // Methods for io::writer #[inline] - fn write(&mut self, msg: &[u8]) { + fn write(&mut self, msg: &[u8]) -> IoResult<()> { let length = msg.len(); self.length += length; @@ -180,7 +181,7 @@ impl Writer for SipState { t += 1; } self.ntail += length; - return; + return Ok(()) } let mut t = 0; @@ -222,17 +223,14 @@ impl Writer for SipState { t += 1 } self.ntail = left; - } - - fn flush(&mut self) { - // No-op + Ok(()) } } impl Streaming for SipState { #[inline] fn input(&mut self, buf: &[u8]) { - self.write(buf); + self.write(buf).unwrap(); } #[inline] |
