Skip to content

Commit 1c2cb29

Browse files
authored
chore: bump rust toolchain (#12183)
* chore: bump rust toolchain * chore: fix clippy and add -Cforce-unwind-tables=no rustflag
1 parent b20fd92 commit 1c2cb29

File tree

21 files changed

+43
-65
lines changed

21 files changed

+43
-65
lines changed

crates/node_binding/scripts/build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ async function build() {
8787
}
8888
if (values.profile === "release") {
8989
features.push("info-level");
90+
rustflags.push("-Cforce-unwind-tables=no");
9091
}
9192
if (features.length) {
9293
args.push("--features " + features.join(","));

crates/rspack/src/builder/builder_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::enum_variant_names)]
12
use enum_tag::EnumTag;
23
use rspack_core::{
34
BoxPlugin, ChunkLoadingType, CompilerOptions, EntryOptions, ExternalItem, ExternalType,
@@ -7,8 +8,7 @@ use rspack_core::{
78
/// Options of builtin plugins
89
///
910
/// The order of this list is strictly ordered with respect to `rspackOptionsApply`.
10-
#[allow(clippy::enum_variant_names)]
11-
#[derive(Debug, EnumTag)]
11+
#[derive(EnumTag, Debug)]
1212
#[repr(u8)]
1313
pub(super) enum BuiltinPluginOptions {
1414
// External handling plugins

crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ impl ChunkGraph {
10741074

10751075
// Merge id name hints
10761076
for hint in chunk_b.id_name_hints() {
1077-
chunk_a.add_id_name_hints(hint.to_string());
1077+
chunk_a.add_id_name_hints(hint.clone());
10781078
}
10791079

10801080
// Merge runtime

crates/rspack_core/src/chunk_graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl ChunkGraph {
101101
.map(|chunk_name| format!(" <tr><td>{chunk_name}</td></tr>"))
102102
.join("\n");
103103

104-
let table_body = requests.to_string();
104+
let table_body = requests.clone();
105105

106106
format!("\n<<table bgcolor=\"{bg_color}\">\n{table_header}\n{table_body}\n</table>>\n")
107107
};

crates/rspack_core/src/chunk_group.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,7 @@ impl ChunkGroup {
111111
self
112112
.chunks
113113
.iter()
114-
.flat_map(|chunk_ukey| {
115-
chunk_by_ukey
116-
.expect_get(chunk_ukey)
117-
.files()
118-
.iter()
119-
.map(|file| file.to_string())
120-
})
114+
.flat_map(|chunk_ukey| chunk_by_ukey.expect_get(chunk_ukey).files().iter().cloned())
121115
.collect()
122116
}
123117

crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ Or do you want to use the entrypoints '{name}' and '{runtime}' independently on
636636
}
637637
None => {
638638
let (chunk_ukey, created) = Compilation::add_named_chunk(
639-
runtime.to_string(),
639+
runtime.clone(),
640640
&mut compilation.chunk_by_ukey,
641641
&mut compilation.named_chunks,
642642
);

crates/rspack_core/src/compilation/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ impl Compilation {
596596
let import_var_map_of_module = runtime_map
597597
.entry(
598598
runtime
599-
.map(|r| get_runtime_key(r).to_string())
599+
.map(|r| get_runtime_key(r).clone())
600600
.unwrap_or_default(),
601601
)
602602
.or_default();
@@ -838,7 +838,7 @@ impl Compilation {
838838
if let Some(related_in_info) = self.assets_related_in.get(filename) {
839839
for name in related_in_info {
840840
if let Some(asset) = self.assets.get_mut(name) {
841-
asset.get_info_mut().related.source_map = Some(new_name.to_string());
841+
asset.get_info_mut().related.source_map = Some(new_name.clone());
842842
}
843843
}
844844
}

crates/rspack_core/src/compiler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ impl Compiler {
381381
.incremental
382382
.passes_enabled(IncrementalPasses::EMIT_ASSETS)
383383
{
384-
new_emitted_asset_versions.insert(filename.to_string(), asset.info.version.clone());
384+
new_emitted_asset_versions.insert(filename.clone(), asset.info.version.clone());
385385
}
386386

387387
if let Some(old_version) = self.emitted_asset_versions.get(filename)

crates/rspack_core/src/concatenated_module.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -870,10 +870,8 @@ impl Module for ConcatenatedModule {
870870

871871
if let Some(import_map) = &info.import_map {
872872
for ((source, _), imported_atoms) in import_map.iter() {
873-
escaped_identifiers.insert(
874-
source.to_string(),
875-
split_readable_identifier(source.as_str()),
876-
);
873+
escaped_identifiers
874+
.insert(source.clone(), split_readable_identifier(source.as_str()));
877875
for atom in imported_atoms {
878876
escaped_names.insert(atom.to_string(), escape_name(atom.as_str()));
879877
}
@@ -1969,7 +1967,7 @@ impl ConcatenatedModule {
19691967
mg_cache: &ModuleGraphCacheArtifact,
19701968
) -> Vec<ConcatenationEntry> {
19711969
mg_cache.cached_concatenated_module_entries(
1972-
(self.id, runtime.map(|r| get_runtime_key(r).to_string())),
1970+
(self.id, runtime.map(|r| get_runtime_key(r).clone())),
19731971
|| {
19741972
let root_module = self.root_module_ctxt.id;
19751973
let module_set: IdentifierIndexSet = self.modules.iter().map(|item| item.id).collect();
@@ -3064,7 +3062,7 @@ pub fn find_new_name(old_name: &str, used_names: &HashSet<Atom>, extra_info: &Ve
30643062
if name.is_empty() {
30653063
String::new()
30663064
} else if name.starts_with('_') || info_part.ends_with('_') {
3067-
name.to_string()
3065+
name.clone()
30683066
} else {
30693067
format!("_{name}")
30703068
}

crates/rspack_core/src/context_module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl ContextModule {
231231
ChunkGraph::get_module_id(&compilation.module_ids_artifact, *m)
232232
.map(|id| (id.to_string(), dep))
233233
})
234-
.sorted_unstable_by_key(|(module_id, _)| module_id.to_string());
234+
.sorted_unstable_by_key(|(module_id, _)| module_id.clone());
235235
for (module_id, dep) in sorted_modules {
236236
let exports_type = get_exports_type_with_strict(
237237
&compilation.get_module_graph(),

0 commit comments

Comments
 (0)