Upgrade to rustfmt 0.7.1

This commit is contained in:
Jakob Stoklund Olesen
2017-01-25 15:17:27 -08:00
parent 70957cc7ce
commit 859cca081c
4 changed files with 23 additions and 29 deletions

View File

@@ -96,10 +96,8 @@ impl ConcurrentRunner {
fn heartbeat_thread(replies: Sender<Reply>) -> thread::JoinHandle<()> { fn heartbeat_thread(replies: Sender<Reply>) -> thread::JoinHandle<()> {
thread::Builder::new() thread::Builder::new()
.name("heartbeat".to_string()) .name("heartbeat".to_string())
.spawn(move || { .spawn(move || while replies.send(Reply::Tick).is_ok() {
while replies.send(Reply::Tick).is_ok() {
thread::sleep(Duration::from_secs(1)); thread::sleep(Duration::from_secs(1));
}
}) })
.unwrap() .unwrap()
} }

View File

@@ -30,7 +30,7 @@ function banner() {
# rustfmt is installed. # rustfmt is installed.
# #
# This version should always be bumped to the newest version available. # 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 if cargo install --list | grep -q "^rustfmt v$RUSTFMT_VERSION"; then
banner "Rust formatting" banner "Rust formatting"

View File

@@ -66,12 +66,10 @@ impl RegBank {
} }
} }
} }
.and_then(|offset| { .and_then(|offset| if offset < self.units {
if offset < self.units {
Some(offset + self.first_unit) Some(offset + self.first_unit)
} else { } else {
None None
}
}) })
} }

View File

@@ -62,8 +62,7 @@ impl SourceMap {
/// Look up an entity by source name. /// Look up an entity by source name.
/// Returns the entity reference corresponding to `name`, if it exists. /// Returns the entity reference corresponding to `name`, if it exists.
pub fn lookup_str(&self, name: &str) -> Option<AnyEntity> { pub fn lookup_str(&self, name: &str) -> Option<AnyEntity> {
split_entity_name(name).and_then(|(ent, num)| { split_entity_name(name).and_then(|(ent, num)| match ent {
match ent {
"v" => { "v" => {
Value::direct_with_number(num) Value::direct_with_number(num)
.and_then(|v| self.get_value(v)) .and_then(|v| self.get_value(v))
@@ -80,7 +79,6 @@ impl SourceMap {
"fn" => self.get_fn(num).map(AnyEntity::FuncRef), "fn" => self.get_fn(num).map(AnyEntity::FuncRef),
"jt" => self.get_jt(num).map(AnyEntity::JumpTable), "jt" => self.get_jt(num).map(AnyEntity::JumpTable),
_ => None, _ => None,
}
}) })
} }