Skip to content

Commit 0e36d5b

Browse files
authored
chore: update rust channel to support sftrace (#10539)
* chore: update rust channel to support sftrace * chore: fix clippy rule * chore: fix more clippy rule * chore: fix clippy * chore: fix clippy
1 parent 15c1fd8 commit 0e36d5b

File tree

104 files changed

+349
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+349
-383
lines changed

crates/node_binding/src/dependencies/entry_dependency.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ impl EntryDependency {
1515
match &self.dependency_id {
1616
Some(dependency_id) => {
1717
Err(napi::Error::from_reason(format!(
18-
"Dependency with id = {:?} has already been resolved. Reusing EntryDependency is not allowed because Rust requires its ownership.",
19-
dependency_id
18+
"Dependency with id = {dependency_id:?} has already been resolved. Reusing EntryDependency is not allowed because Rust requires its ownership."
2019
)))
2120
}
2221
None => {

crates/node_binding/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ fn init() {
415415
.thread_name_fn(|| {
416416
static ATOMIC_ID: AtomicUsize = AtomicUsize::new(0);
417417
let id = ATOMIC_ID.fetch_add(1, Ordering::SeqCst);
418-
format!("tokio-{}", id)
418+
format!("tokio-{id}")
419419
})
420420
.enable_all()
421421
.build()

crates/node_binding/src/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn install_panic_handler() {
5454
{
5555
use rspack_core::debug_info::DEBUG_INFO;
5656
if let Ok(info) = DEBUG_INFO.lock() {
57-
eprintln!("{}", info);
57+
eprintln!("{info}");
5858
}
5959
}
6060
panic_handler(panic);

crates/node_binding/src/raw_options/raw_builtins/raw_lazy_compilation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl From<RawLazyCompilationTest> for LazyCompilationTest<LazyCompilationTestFn>
7070
match value.0 {
7171
Either::A(regex) => Self::Regex(
7272
RspackRegex::with_flags(&regex.source, &regex.flags).unwrap_or_else(|_| {
73-
let msg = format!("[lazyCompilation]incorrect regex {:?}", regex);
73+
let msg = format!("[lazyCompilation]incorrect regex {regex:?}");
7474
panic!("{msg}");
7575
}),
7676
),

crates/node_binding/src/raw_options/raw_builtins/raw_lightning_css_minimizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl TryFrom<RawLightningCssMinimizerRspackPluginOptions> for PluginOptions {
8888
.targets
8989
.map(browserslist_to_lightningcss_targets)
9090
.transpose()
91-
.to_rspack_result_with_message(|e| format!("Failed to parse browserslist: {}", e))?
91+
.to_rspack_result_with_message(|e| format!("Failed to parse browserslist: {e}"))?
9292
.flatten(),
9393
include: value.minimizer_options.include,
9494
exclude: value.minimizer_options.exclude,

crates/node_binding/src/raw_options/raw_module/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ pub enum RawRuleSetCondition {
5252
impl Debug for RawRuleSetCondition {
5353
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5454
match self {
55-
RawRuleSetCondition::string(s) => write!(f, "RawRuleSetCondition::string({:?})", s),
56-
RawRuleSetCondition::regexp(r) => write!(f, "RawRuleSetCondition::regexp({:?})", r),
57-
RawRuleSetCondition::logical(l) => write!(f, "RawRuleSetCondition::logical({:?})", l),
58-
RawRuleSetCondition::array(a) => write!(f, "RawRuleSetCondition::array({:?})", a),
55+
RawRuleSetCondition::string(s) => write!(f, "RawRuleSetCondition::string({s:?})"),
56+
RawRuleSetCondition::regexp(r) => write!(f, "RawRuleSetCondition::regexp({r:?})"),
57+
RawRuleSetCondition::logical(l) => write!(f, "RawRuleSetCondition::logical({l:?})"),
58+
RawRuleSetCondition::array(a) => write!(f, "RawRuleSetCondition::array({a:?})"),
5959
RawRuleSetCondition::func(_) => write!(f, "RawRuleSetCondition::func(...)"),
6060
}
6161
}

crates/node_binding/src/resolver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl JsResolver {
5050
Ok(Either::A(ResourceData::from(resource).into()))
5151
}
5252
Ok(rspack_core::ResolveResult::Ignored) => Ok(Either::B(false)),
53-
Err(err) => Err(napi::Error::from_reason(format!("{:?}", err))),
53+
Err(err) => Err(napi::Error::from_reason(format!("{err:?}"))),
5454
}
5555
})
5656
}
@@ -74,7 +74,7 @@ impl JsResolver {
7474
Either::<JsResourceData, bool>::A(ResourceData::from(resource).into()),
7575
),
7676
Ok(rspack_core::ResolveResult::Ignored) => Ok(Either::B(false)),
77-
Err(err) => Err(napi::Error::from_reason(format!("{:?}", err))),
77+
Err(err) => Err(napi::Error::from_reason(format!("{err:?}"))),
7878
}
7979
},
8080
|| {},

crates/node_binding/src/resolver_factory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl JsResolverFactory {
8282
Ok(JsResolver::new(resolver_factory, options))
8383
}
8484
_ => {
85-
Err(napi::Error::from_reason(format!("Invalid resolver type '{}' specified. Rspack only supports 'normal', 'context', and 'loader' types.", r#type)))
85+
Err(napi::Error::from_reason(format!("Invalid resolver type '{type}' specified. Rspack only supports 'normal', 'context', and 'loader' types.")))
8686
}
8787
}
8888
}

crates/node_binding/src/swc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub async fn transform(source: String, options: String) -> napi::Result<Transfor
3636
|_| noop_pass(),
3737
)
3838
.map(TransformOutput::from)
39-
.map_err(|e| napi::Error::new(napi::Status::GenericFailure, format!("{}", e)))
39+
.map_err(|e| napi::Error::new(napi::Status::GenericFailure, format!("{e}")))
4040
}
4141

4242
#[napi]
@@ -55,7 +55,7 @@ pub async fn minify(source: String, options: String) -> napi::Result<TransformOu
5555
let v = e.into_inner();
5656
let err = v
5757
.into_iter()
58-
.map(|e| format!("{:?}", e))
58+
.map(|e| format!("{e:?}"))
5959
.collect::<Vec<_>>()
6060
.join("\n");
6161

crates/rspack_cacheable/src/deserialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl std::fmt::Display for DeserializeError {
2626
match self {
2727
Self::BoxedError(error) => error.fmt(f),
2828
Self::MessageError(msg) => {
29-
write!(f, "{}", msg)
29+
write!(f, "{msg}")
3030
}
3131
Self::DynCheckBytesNotRegister => {
3232
write!(f, "cacheable_dyn check bytes not register")

0 commit comments

Comments
 (0)