Upgrade to rustfmt 0.7.1
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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<AnyEntity> {
|
||||
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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -96,10 +96,8 @@ impl ConcurrentRunner {
|
||||
fn heartbeat_thread(replies: Sender<Reply>) -> 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()
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user