Skip to content

Commit a1521c3

Browse files
authored
Upgrade to Rust stable 1.47.0. (#10933)
The changelog is here: https://blog.rust-lang.org/2020/10/08/Rust-1.47.html The most relevant change is shorter backtraces by default: https://blog.rust-lang.org/2020/10/08/Rust-1.47.html#shorter-backtraces
1 parent cd22820 commit a1521c3

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.46.0
1+
1.47.0

src/rust/engine/fs/src/lib.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,7 @@ impl GitignoreStyleExcludes {
305305
}
306306

307307
fn is_ignored(&self, stat: &Stat) -> bool {
308-
let is_dir = match stat {
309-
&Stat::Dir(_) => true,
310-
_ => false,
311-
};
308+
let is_dir = matches!(stat, &Stat::Dir(_));
312309
self.is_ignored_path(stat.path(), is_dir)
313310
}
314311

@@ -357,17 +354,11 @@ impl StrictGlobMatching {
357354
}
358355

359356
pub fn should_check_glob_matches(&self) -> bool {
360-
match self {
361-
&StrictGlobMatching::Ignore => false,
362-
_ => true,
363-
}
357+
!matches!(self, &StrictGlobMatching::Ignore)
364358
}
365359

366360
pub fn should_throw_on_error(&self) -> bool {
367-
match self {
368-
&StrictGlobMatching::Error(_) => true,
369-
_ => false,
370-
}
361+
matches!(self, &StrictGlobMatching::Error(_))
371362
}
372363
}
373364

src/rust/engine/graph/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -686,13 +686,9 @@ impl<N: Node> Graph<N> {
686686
) -> Result<Vec<Generation>, N::Error> {
687687
let generations = {
688688
let inner = self.inner.lock();
689-
let dep_ids = inner
689+
inner
690690
.pg
691691
.neighbors_directed(entry_id, Direction::Outgoing)
692-
.collect::<Vec<_>>();
693-
694-
dep_ids
695-
.into_iter()
696692
.map(|dep_id| {
697693
let mut entry = inner
698694
.entry_for_id(dep_id)

src/rust/engine/rule_graph/src/builder.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,13 @@ impl<R: Rule> Builder<R> {
10151015
to_visit.extend(
10161016
edge_refs
10171017
.iter()
1018-
.filter(|edge_ref| match graph[edge_ref.target()].deleted_reason() {
1019-
Some(NodePrunedReason::Ambiguous)
1020-
| Some(NodePrunedReason::NoSourceOfParam)
1021-
| Some(NodePrunedReason::NoValidCombinationsOfDependencies) => true,
1022-
_ => false,
1018+
.filter(|edge_ref| {
1019+
matches!(
1020+
graph[edge_ref.target()].deleted_reason(),
1021+
Some(NodePrunedReason::Ambiguous)
1022+
| Some(NodePrunedReason::NoSourceOfParam)
1023+
| Some(NodePrunedReason::NoValidCombinationsOfDependencies)
1024+
)
10231025
})
10241026
.map(|edge_ref| edge_ref.target()),
10251027
);

0 commit comments

Comments
 (0)