Skip to content

Commit 4007add

Browse files
committed
bump: rust to 1.52.0
1 parent 72dfbe2 commit 4007add

9 files changed

Lines changed: 16 additions & 23 deletions

File tree

crates/mun_codegen/src/code_gen/assembly_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ impl<'db, 'ink, 'ctx, 't> AssemblyBuilder<'db, 'ink, 'ctx, 't> {
2929

3030
Self {
3131
code_gen,
32+
module_group_partition,
3233
module_group_id,
3334
assembly_module,
34-
module_group_partition,
3535
}
3636
}
3737

crates/mun_codegen/src/module_group.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ impl ModuleGroup {
5353

5454
Self {
5555
ordered_modules,
56-
name,
57-
includes_entire_subtree,
5856
modules,
57+
includes_entire_subtree,
58+
name,
5959
}
6060
}
6161

crates/mun_hir/src/module_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ impl ModuleTree {
110110
}
111111

112112
Arc::new(ModuleTree {
113+
root,
114+
modules,
113115
package,
114116
diagnostics,
115-
modules,
116-
root,
117117
})
118118
}
119119

crates/mun_hir/src/name_resolution/path_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ impl ResolvePathResult {
4141
) -> ResolvePathResult {
4242
ResolvePathResult {
4343
resolved_def,
44-
reached_fixedpoint,
4544
segment_index,
45+
reached_fixedpoint,
4646
package,
4747
}
4848
}

crates/mun_language_server/src/state.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,7 @@ impl LanguageServerState {
347347
.file_contents(file.file_id)
348348
.map(Vec::from)
349349
.unwrap_or_default();
350-
let text = match String::from_utf8(bytes).ok() {
351-
Some(text) => Some(Arc::from(text)),
352-
None => None,
353-
};
350+
let text = String::from_utf8(bytes).ok().map(Arc::from);
354351

355352
// Notify the database about this change
356353
analysis_change.change_file(hir::FileId(file.file_id.0), text);

crates/mun_memory/src/diff.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ fn append_primitive_mapping<T>(
131131
let mut insertions: Vec<Option<usize>> = insertions.into_iter().map(Some).collect();
132132

133133
// For all deletions,
134+
#[allow(clippy::manual_flatten)]
134135
'outer: for old_idx in deletions {
135136
let old_ty = unsafe { old.get_unchecked(old_idx) };
136137
// is there an insertion
@@ -154,10 +155,8 @@ fn append_primitive_mapping<T>(
154155
}
155156

156157
// If an insertion did not have a matching deletion, then `Insert` it.
157-
for insertion in insertions {
158-
if let Some(index) = insertion {
159-
mapping.push(Diff::Insert { index });
160-
}
158+
for index in insertions.into_iter().flatten() {
159+
mapping.push(Diff::Insert { index });
161160
}
162161
}
163162

@@ -296,6 +295,7 @@ where
296295

297296
let mut mapping = Vec::with_capacity(diff.len());
298297
// For all deletions,
298+
#[allow(clippy::manual_flatten)]
299299
'outer: for old_idx in deletions {
300300
let old_ty = unsafe { old.get_unchecked(old_idx) };
301301
// is there an insertion with the same name and type `T`?
@@ -391,10 +391,8 @@ where
391391
}
392392

393393
// If an insertion did not have a matching deletion, then insert it.
394-
for insertion in insertions {
395-
if let Some(index) = insertion {
396-
mapping.push(FieldDiff::Insert { index });
397-
}
394+
for index in insertions.into_iter().flatten() {
395+
mapping.push(FieldDiff::Insert { index });
398396
}
399397

400398
mapping.shrink_to_fit();

crates/mun_runtime/src/adt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl RootedStruct {
310310
GcRootPtr::new(&runtime_ref.gc, raw.0)
311311
};
312312

313-
Self { runtime, handle }
313+
Self { handle, runtime }
314314
}
315315

316316
/// Converts the `RootedStruct` into a `StructRef`, using an external shared reference to a

crates/mun_syntax/src/ast/expr_extensions.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,8 @@ impl ast::FieldExpr {
176176
pub fn field_access(&self) -> Option<FieldKind> {
177177
if let Some(nr) = self.name_ref() {
178178
Some(FieldKind::Name(nr))
179-
} else if let Some(tok) = self.index_token() {
180-
Some(FieldKind::Index(tok))
181179
} else {
182-
None
180+
self.index_token().map(FieldKind::Index)
183181
}
184182
}
185183

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.51.0
1+
1.52.0

0 commit comments

Comments
 (0)