From c132b8c328c74687da3b7da38b0ed456559985ad Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 25 Jan 2017 15:17:27 -0800 Subject: [PATCH] Upgrade to rustfmt 0.7.1 --- lib/cretonne/src/isa/registers.rs | 10 ++++----- lib/reader/src/sourcemap.rs | 34 +++++++++++++++---------------- src/filetest/concurrent.rs | 6 ++---- test-all.sh | 2 +- 4 files changed, 23 insertions(+), 29 deletions(-) diff --git a/lib/cretonne/src/isa/registers.rs b/lib/cretonne/src/isa/registers.rs index b223a3b5b0..f8c2ee5731 100644 --- a/lib/cretonne/src/isa/registers.rs +++ b/lib/cretonne/src/isa/registers.rs @@ -66,12 +66,10 @@ impl RegBank { } } } - .and_then(|offset| { - if offset < self.units { - Some(offset + self.first_unit) - } else { - None - } + .and_then(|offset| if offset < self.units { + Some(offset + self.first_unit) + } else { + None }) } diff --git a/lib/reader/src/sourcemap.rs b/lib/reader/src/sourcemap.rs index 26d874817d..369e732e90 100644 --- a/lib/reader/src/sourcemap.rs +++ b/lib/reader/src/sourcemap.rs @@ -62,25 +62,23 @@ impl SourceMap { /// Look up an entity by source name. /// Returns the entity reference corresponding to `name`, if it exists. pub fn lookup_str(&self, name: &str) -> Option { - split_entity_name(name).and_then(|(ent, num)| { - match ent { - "v" => { - Value::direct_with_number(num) - .and_then(|v| self.get_value(v)) - .map(AnyEntity::Value) - } - "vx" => { - Value::table_with_number(num) - .and_then(|v| self.get_value(v)) - .map(AnyEntity::Value) - } - "ebb" => Ebb::with_number(num).and_then(|e| self.get_ebb(e)).map(AnyEntity::Ebb), - "ss" => self.get_ss(num).map(AnyEntity::StackSlot), - "sig" => self.get_sig(num).map(AnyEntity::SigRef), - "fn" => self.get_fn(num).map(AnyEntity::FuncRef), - "jt" => self.get_jt(num).map(AnyEntity::JumpTable), - _ => None, + split_entity_name(name).and_then(|(ent, num)| match ent { + "v" => { + Value::direct_with_number(num) + .and_then(|v| self.get_value(v)) + .map(AnyEntity::Value) } + "vx" => { + Value::table_with_number(num) + .and_then(|v| self.get_value(v)) + .map(AnyEntity::Value) + } + "ebb" => Ebb::with_number(num).and_then(|e| self.get_ebb(e)).map(AnyEntity::Ebb), + "ss" => self.get_ss(num).map(AnyEntity::StackSlot), + "sig" => self.get_sig(num).map(AnyEntity::SigRef), + "fn" => self.get_fn(num).map(AnyEntity::FuncRef), + "jt" => self.get_jt(num).map(AnyEntity::JumpTable), + _ => None, }) } diff --git a/src/filetest/concurrent.rs b/src/filetest/concurrent.rs index 30abb844d4..e0afc8bead 100644 --- a/src/filetest/concurrent.rs +++ b/src/filetest/concurrent.rs @@ -96,10 +96,8 @@ impl ConcurrentRunner { fn heartbeat_thread(replies: Sender) -> thread::JoinHandle<()> { thread::Builder::new() .name("heartbeat".to_string()) - .spawn(move || { - while replies.send(Reply::Tick).is_ok() { - thread::sleep(Duration::from_secs(1)); - } + .spawn(move || while replies.send(Reply::Tick).is_ok() { + thread::sleep(Duration::from_secs(1)); }) .unwrap() } diff --git a/test-all.sh b/test-all.sh index ef85cd19ee..8035703488 100755 --- a/test-all.sh +++ b/test-all.sh @@ -30,7 +30,7 @@ function banner() { # rustfmt is installed. # # This version should always be bumped to the newest version available. -RUSTFMT_VERSION="0.6.3" +RUSTFMT_VERSION="0.7.1" if cargo install --list | grep -q "^rustfmt v$RUSTFMT_VERSION"; then banner "Rust formatting"