From c0defda4994b2cf292901c24bef88b37a088861e Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 20 Feb 2013 18:04:57 -0800 Subject: librustc: Separate the rest of the trait bounds with `+` and stop parsing space-separated ones. rs=plussing --- src/libstd/flatpipes.rs | 10 +++++----- src/libstd/workcache.rs | 28 ++++++++-------------------- 2 files changed, 13 insertions(+), 25 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs index f97e5ee6800..80f93323a8e 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -151,7 +151,7 @@ pub mod serial { } /// Create a pair of `FlatChan` and `FlatPort`, backed by pipes - pub fn pipe_stream + pub fn pipe_stream + Decodable>( ) -> (PipePort, PipeChan) { let (port, chan) = pipes::stream(); @@ -443,8 +443,8 @@ pub mod flatteners { SerializingFlattener */ - pub fn deserialize_buffer>(buf: &[u8]) -> T { + pub fn deserialize_buffer>(buf: &[u8]) -> T { let buf = vec::from_slice(buf); let buf_reader = @BufReader::new(buf); let reader = buf_reader as @Reader; @@ -452,8 +452,8 @@ pub mod flatteners { Decodable::decode(&deser) } - pub fn serialize_value>(val: &T) -> ~[u8] { + pub fn serialize_value>(val: &T) -> ~[u8] { let bytes_writer = @BytesWriter(); let writer = bytes_writer as @Writer; let ser = FromWriter::from_writer(writer); diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index 4de7c1b9925..a06dee723c8 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -260,9 +260,7 @@ impl Context { Context{db: db, logger: lg, cfg: cfg, freshness: LinearMap::new()} } - fn prep - Decodable>( + fn prep + Decodable>( @self, fn_name:&str, blk: fn(@Mut)->Work) -> Work { @@ -278,9 +276,8 @@ trait TPrep { fn declare_input(&self, kind:&str, name:&str, val:&str); fn is_fresh(&self, cat:&str, kind:&str, name:&str, val:&str) -> bool; fn all_fresh(&self, cat:&str, map:&WorkMap) -> bool; - fn exec - Decodable>(&self, blk: ~fn(&Exec) -> T) -> Work; + fn exec + Decodable>( + &self, blk: ~fn(&Exec) -> T) -> Work; } impl TPrep for @Mut { @@ -318,11 +315,8 @@ impl TPrep for @Mut { return true; } - fn exec - Decodable>(&self, - blk: ~fn(&Exec) -> T) -> Work { - + fn exec + Decodable>( + &self, blk: ~fn(&Exec) -> T) -> Work { let mut bo = Some(blk); do self.borrow_imm |p| { @@ -360,20 +354,15 @@ impl TPrep for @Mut { } } -impl - Decodable> - Work { +impl + Decodable> Work { static fn new(p: @Mut, e: Either>) -> Work { Work { prep: p, res: Some(e) } } } // FIXME (#3724): movable self. This should be in impl Work. -fn unwrap - Decodable>(w: Work) -> T { - +fn unwrap + Decodable>( + w: Work) -> T { let mut ww = w; let mut s = None; @@ -383,7 +372,6 @@ fn unwrap fail!(), Some(Left(v)) => v, Some(Right(port)) => { - let (exe, v) = match recv(port) { oneshot::send(data) => data }; -- cgit 1.4.1-3-g733a5