diff options
Diffstat (limited to 'src/libworkcache')
| -rw-r--r-- | src/libworkcache/lib.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libworkcache/lib.rs b/src/libworkcache/lib.rs index 3e513472027..a049279c5c4 100644 --- a/src/libworkcache/lib.rs +++ b/src/libworkcache/lib.rs @@ -203,7 +203,7 @@ impl Database { self.db_filename.display(), e.to_str()), Ok(r) => { let mut decoder = json::Decoder::new(r); - self.db_cache = Decodable::decode(&mut decoder); + self.db_cache = Decodable::decode(&mut decoder).unwrap(); } } } @@ -252,19 +252,19 @@ enum Work<'a, T> { WorkFromTask(&'a Prep<'a>, Receiver<(Exec, T)>), } -fn json_encode<'a, T:Encodable<json::Encoder<'a>>>(t: &T) -> ~str { +fn json_encode<'a, T:Encodable<json::Encoder<'a>, io::IoError>>(t: &T) -> ~str { let mut writer = MemWriter::new(); let mut encoder = json::Encoder::new(&mut writer as &mut io::Writer); - t.encode(&mut encoder); + let _ = t.encode(&mut encoder); str::from_utf8_owned(writer.unwrap()).unwrap() } // FIXME(#5121) -fn json_decode<T:Decodable<json::Decoder>>(s: &str) -> T { +fn json_decode<T:Decodable<json::Decoder, json::Error>>(s: &str) -> T { debug!("json decoding: {}", s); let j = json::from_str(s).unwrap(); let mut decoder = json::Decoder::new(j); - Decodable::decode(&mut decoder) + Decodable::decode(&mut decoder).unwrap() } impl Context { @@ -392,15 +392,15 @@ impl<'a> Prep<'a> { } pub fn exec<'a, T:Send + - Encodable<json::Encoder<'a>> + - Decodable<json::Decoder>>( + Encodable<json::Encoder<'a>, io::IoError> + + Decodable<json::Decoder, json::Error>>( &'a self, blk: proc:Send(&mut Exec) -> T) -> T { self.exec_work(blk).unwrap() } fn exec_work<'a, T:Send + - Encodable<json::Encoder<'a>> + - Decodable<json::Decoder>>( // FIXME(#5121) + Encodable<json::Encoder<'a>, io::IoError> + + Decodable<json::Decoder, json::Error>>( // FIXME(#5121) &'a self, blk: proc:Send(&mut Exec) -> T) -> Work<'a, T> { let mut bo = Some(blk); @@ -443,8 +443,8 @@ impl<'a> Prep<'a> { } impl<'a, T:Send + - Encodable<json::Encoder<'a>> + - Decodable<json::Decoder>> + Encodable<json::Encoder<'a>, io::IoError> + + Decodable<json::Decoder, json::Error>> Work<'a, T> { // FIXME(#5121) pub fn from_value(elt: T) -> Work<'a, T> { |
