Unverified Commit 1866e440 authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Update rust toolchain to 2025-05-12 (#79099)

Clippy now warns on [uninlined format
strings](https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args).
Applied fixers with `cargo clippy --fix`.
parent 2d440631
...@@ -25,7 +25,7 @@ fn main() -> anyhow::Result<()> { ...@@ -25,7 +25,7 @@ fn main() -> anyhow::Result<()> {
}; };
// Make the Next.js version available as a build-time environment variable // Make the Next.js version available as a build-time environment variable
println!("cargo:rustc-env=NEXTJS_VERSION={}", nextjs_version); println!("cargo:rustc-env=NEXTJS_VERSION={nextjs_version}");
// Generates, stores build-time information as static values. // Generates, stores build-time information as static values.
// There are some places relying on correct values for this (i.e telemetry), // There are some places relying on correct values for this (i.e telemetry),
......
...@@ -40,5 +40,5 @@ pub fn mdx_compile_sync(value: String, option: Buffer) -> napi::Result<String> { ...@@ -40,5 +40,5 @@ pub fn mdx_compile_sync(value: String, option: Buffer) -> napi::Result<String> {
let option: Options = serde_json::from_slice(&option)?; let option: Options = serde_json::from_slice(&option)?;
compile(value.as_str(), &option) compile(value.as_str(), &option)
.map_err(|err| napi::Error::new(Status::GenericFailure, format!("{:?}", err))) .map_err(|err| napi::Error::new(Status::GenericFailure, format!("{err:?}")))
} }
...@@ -66,9 +66,9 @@ use crate::{register, util::DhatProfilerGuard}; ...@@ -66,9 +66,9 @@ use crate::{register, util::DhatProfilerGuard};
/// Used by [`benchmark_file_io`]. This is a noisy benchmark, so set the /// Used by [`benchmark_file_io`]. This is a noisy benchmark, so set the
/// threshold high. /// threshold high.
const SLOW_FILESYSTEM_THRESHOLD: Duration = Duration::from_millis(100); const SLOW_FILESYSTEM_THRESHOLD: Duration = Duration::from_millis(100);
static SOURCE_MAP_PREFIX: Lazy<String> = Lazy::new(|| format!("{}///", SOURCE_URL_PROTOCOL)); static SOURCE_MAP_PREFIX: Lazy<String> = Lazy::new(|| format!("{SOURCE_URL_PROTOCOL}///"));
static SOURCE_MAP_PREFIX_PROJECT: Lazy<String> = static SOURCE_MAP_PREFIX_PROJECT: Lazy<String> =
Lazy::new(|| format!("{}///[{}]/", SOURCE_URL_PROTOCOL, PROJECT_FILESYSTEM_NAME)); Lazy::new(|| format!("{SOURCE_URL_PROTOCOL}///[{PROJECT_FILESYSTEM_NAME}]/"));
#[napi(object)] #[napi(object)]
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
...@@ -1213,7 +1213,7 @@ pub fn project_update_info_subscribe( ...@@ -1213,7 +1213,7 @@ pub fn project_update_info_subscribe(
if !matches!(status, Status::Ok) { if !matches!(status, Status::Ok) {
let error = anyhow!("Error calling JS function: {}", status); let error = anyhow!("Error calling JS function: {}", status);
eprintln!("{}", error); eprintln!("{error}");
break; break;
} }
} }
...@@ -1376,7 +1376,7 @@ pub async fn project_trace_source( ...@@ -1376,7 +1376,7 @@ pub async fn project_trace_source(
( (
get_relative_path_to( get_relative_path_to(
&current_directory_file_url, &current_directory_file_url,
&format!("{}{}", project_root_uri, source_file), &format!("{project_root_uri}{source_file}"),
) )
// TODO(sokra) remove this to include a ./ here to make it a relative path // TODO(sokra) remove this to include a ./ here to make it a relative path
.trim_start_matches("./") .trim_start_matches("./")
......
...@@ -471,7 +471,7 @@ pub fn subscribe<T: 'static + Send + Sync, F: Future<Output = Result<T>> + Send, ...@@ -471,7 +471,7 @@ pub fn subscribe<T: 'static + Send + Sync, F: Future<Output = Result<T>> + Send,
); );
if !matches!(status, Status::Ok) { if !matches!(status, Status::Ok) {
let error = anyhow!("Error calling JS function: {}", status); let error = anyhow!("Error calling JS function: {}", status);
eprintln!("{}", error); eprintln!("{error}");
return Err::<Vc<()>, _>(error); return Err::<Vc<()>, _>(error);
} }
Ok(Default::default()) Ok(Default::default())
......
...@@ -119,7 +119,7 @@ impl Task for TransformTask { ...@@ -119,7 +119,7 @@ impl Task for TransformTask {
self.c.cm.new_source_file( self.c.cm.new_source_file(
FileName::Real(filename.into()).into(), FileName::Real(filename.into()).into(),
read_to_string(filename).with_context(|| { read_to_string(filename).with_context(|| {
format!("Failed to read source code from {}", filename) format!("Failed to read source code from {filename}")
})?, })?,
) )
} }
...@@ -179,10 +179,7 @@ impl Task for TransformTask { ...@@ -179,10 +179,7 @@ impl Task for TransformTask {
}) })
.map_err(|e| e.to_pretty_error()) .map_err(|e| e.to_pretty_error())
.convert_err(), .convert_err(),
Err(err) => Err(napi::Error::new( Err(err) => Err(napi::Error::new(Status::GenericFailure, format!("{err:?}"))),
Status::GenericFailure,
format!("{:?}", err),
)),
} }
}) })
} }
...@@ -249,7 +246,7 @@ fn test_deser() { ...@@ -249,7 +246,7 @@ fn test_deser() {
let tr: TransformOptions = serde_json::from_str(JSON_STR).unwrap(); let tr: TransformOptions = serde_json::from_str(JSON_STR).unwrap();
println!("{:#?}", tr); println!("{tr:#?}");
} }
#[test] #[test]
...@@ -258,5 +255,5 @@ fn test_deserialize_transform_regenerator() { ...@@ -258,5 +255,5 @@ fn test_deserialize_transform_regenerator() {
let tr: TransformOptions = serde_json::from_str(JSON_STR).unwrap(); let tr: TransformOptions = serde_json::from_str(JSON_STR).unwrap();
println!("{:#?}", tr); println!("{tr:#?}");
} }
...@@ -180,7 +180,7 @@ impl FromNapiValue for NapiRouteHas { ...@@ -180,7 +180,7 @@ impl FromNapiValue for NapiRouteHas {
_ => { _ => {
return Err(napi::Error::new( return Err(napi::Error::new(
Status::GenericFailure, Status::GenericFailure,
format!("invalid type for RouteHas: {}", type_), format!("invalid type for RouteHas: {type_}"),
)) ))
} }
}) })
......
...@@ -108,7 +108,7 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) { ...@@ -108,7 +108,7 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) {
for line in new_lines { for line in new_lines {
match line { match line {
Ok(line) => { Ok(line) => {
writeln!(log_write, "{}", line).unwrap(); writeln!(log_write, "{line}").unwrap();
} }
Err(_) => { Err(_) => {
break; break;
...@@ -169,7 +169,7 @@ pub fn get_target_triple() -> &'static str { ...@@ -169,7 +169,7 @@ pub fn get_target_triple() -> &'static str {
pub trait MapErr<T>: Into<Result<T, anyhow::Error>> { pub trait MapErr<T>: Into<Result<T, anyhow::Error>> {
fn convert_err(self) -> napi::Result<T> { fn convert_err(self) -> napi::Result<T> {
self.into() self.into()
.map_err(|err| napi::Error::new(Status::GenericFailure, format!("{:?}", err))) .map_err(|err| napi::Error::new(Status::GenericFailure, format!("{err:?}")))
} }
} }
......
...@@ -1975,7 +1975,7 @@ impl Endpoint for AppEndpoint { ...@@ -1975,7 +1975,7 @@ impl Endpoint for AppEndpoint {
} }
.instrument(span) .instrument(span)
.await .await
.with_context(|| format!("Failed to write app endpoint {}", page_name)) .with_context(|| format!("Failed to write app endpoint {page_name}"))
} }
#[turbo_tasks::function] #[turbo_tasks::function]
......
...@@ -51,7 +51,7 @@ pub(crate) async fn create_font_manifest( ...@@ -51,7 +51,7 @@ pub(crate) async fn create_font_manifest(
Default::default() Default::default()
} else if app_dir { } else if app_dir {
let dir_str = dir.to_string().await?; let dir_str = dir.to_string().await?;
let page_path = format!("{}{}", dir_str, original_name).into(); let page_path = format!("{dir_str}{original_name}").into();
NextFontManifest { NextFontManifest {
app: [(page_path, font_paths)].into_iter().collect(), app: [(page_path, font_paths)].into_iter().collect(),
......
...@@ -1196,7 +1196,7 @@ impl Project { ...@@ -1196,7 +1196,7 @@ impl Project {
ConflictIssue { ConflictIssue {
path: self.project_path().to_resolved().await?, path: self.project_path().to_resolved().await?,
title: StyledString::Text( title: StyledString::Text(
format!("App Router and Pages Router both match path: {}", pathname) format!("App Router and Pages Router both match path: {pathname}")
.into(), .into(),
) )
.resolved_cell(), .resolved_cell(),
......
...@@ -169,7 +169,7 @@ fn main() { ...@@ -169,7 +169,7 @@ fn main() {
}; };
let json = serde_json::to_string_pretty(&options).unwrap(); let json = serde_json::to_string_pretty(&options).unwrap();
println!("{}", json); println!("{json}");
} }
} }
} }
...@@ -136,7 +136,7 @@ impl AppPageLoaderTreeBuilder { ...@@ -136,7 +136,7 @@ impl AppPageLoaderTreeBuilder {
let metadata_manifest_route = get_metadata_route_name(manifest).await?; let metadata_manifest_route = get_metadata_route_name(manifest).await?;
// prefix with base_path if it exists // prefix with base_path if it exists
let manifest_route = if let Some(base_path) = &self.base_path { let manifest_route = if let Some(base_path) = &self.base_path {
format!("{}/{}", base_path, metadata_manifest_route) format!("{base_path}/{metadata_manifest_route}")
} else { } else {
metadata_manifest_route.to_string() metadata_manifest_route.to_string()
}; };
...@@ -250,7 +250,7 @@ impl AppPageLoaderTreeBuilder { ...@@ -250,7 +250,7 @@ impl AppPageLoaderTreeBuilder {
let s = " "; let s = " ";
writeln!(self.loader_tree_code, "{s}(async (props) => [{{")?; writeln!(self.loader_tree_code, "{s}(async (props) => [{{")?;
let pathname_prefix = if let Some(base_path) = &self.base_path { let pathname_prefix = if let Some(base_path) = &self.base_path {
format!("{}/{}", base_path, app_page) format!("{base_path}/{app_page}")
} else { } else {
app_page.to_string() app_page.to_string()
}; };
......
...@@ -394,7 +394,7 @@ async fn parse_config_value( ...@@ -394,7 +394,7 @@ async fn parse_config_value(
invalid_config( invalid_config(
source, source,
span, span,
&format!("`dynamic` has an invalid value: {}", err), &format!("`dynamic` has an invalid value: {err}"),
&value, &value,
) )
.await?; .await?;
...@@ -455,7 +455,7 @@ async fn parse_config_value( ...@@ -455,7 +455,7 @@ async fn parse_config_value(
return invalid_config( return invalid_config(
source, source,
span, span,
&format!("`fetchCache` has an invalid value: {}", err), &format!("`fetchCache` has an invalid value: {err}"),
&value, &value,
) )
.await; .await;
...@@ -480,7 +480,7 @@ async fn parse_config_value( ...@@ -480,7 +480,7 @@ async fn parse_config_value(
return invalid_config( return invalid_config(
source, source,
span, span,
&format!("`runtime` has an invalid value: {}", err), &format!("`runtime` has an invalid value: {err}"),
&value, &value,
) )
.await; .await;
......
...@@ -375,7 +375,7 @@ async fn get_directory_tree_internal( ...@@ -375,7 +375,7 @@ async fn get_directory_tree_internal(
.map_or(file_name, |(basename, _)| basename); .map_or(file_name, |(basename, _)| basename);
let alt_path = file let alt_path = file
.parent() .parent()
.join(format!("{}.alt.txt", basename).into()) .join(format!("{basename}.alt.txt").into())
.to_resolved() .to_resolved()
.await?; .await?;
let alt_path = matches!(&*alt_path.get_type().await?, FileSystemEntryType::File) let alt_path = matches!(&*alt_path.get_type().await?, FileSystemEntryType::File)
...@@ -568,9 +568,9 @@ fn conflict_issue( ...@@ -568,9 +568,9 @@ fn conflict_issue(
value_b: &AppPage, value_b: &AppPage,
) { ) {
let item_names = if a == b { let item_names = if a == b {
format!("{}s", a) format!("{a}s")
} else { } else {
format!("{} and {}", a, b) format!("{a} and {b}")
}; };
DirectoryTreeIssue { DirectoryTreeIssue {
...@@ -1038,7 +1038,7 @@ async fn directory_tree_to_loader_tree_internal( ...@@ -1038,7 +1038,7 @@ async fn directory_tree_to_loader_tree_internal(
} }
for key in keys_to_replace { for key in keys_to_replace {
let subdir_name: RcStr = format!("@{}", key).into(); let subdir_name: RcStr = format!("@{key}").into();
let default = if key == "children" { let default = if key == "children" {
modules.default modules.default
......
...@@ -111,7 +111,7 @@ pub async fn get_app_page_entry( ...@@ -111,7 +111,7 @@ pub async fn get_app_page_entry(
let source = VirtualSource::new_with_ident( let source = VirtualSource::new_with_ident(
source source
.ident() .ident()
.with_query(Vc::cell(format!("?{}", query).into())), .with_query(Vc::cell(format!("?{query}").into())),
AssetContent::file(file.into()), AssetContent::file(file.into()),
); );
......
...@@ -126,7 +126,7 @@ pub async fn dynamic_image_metadata_source( ...@@ -126,7 +126,7 @@ pub async fn dynamic_image_metadata_source(
}} }}
"#, "#,
exported_fields_excluding_default = exported_fields_excluding_default, exported_fields_excluding_default = exported_fields_excluding_default,
resource_path = StringifyJs(&format!("./{}.{}", stem, ext)), resource_path = StringifyJs(&format!("./{stem}.{ext}")),
pathname_prefix = StringifyJs(&page.to_string()), pathname_prefix = StringifyJs(&page.to_string()),
page_segment = StringifyJs(stem), page_segment = StringifyJs(stem),
sizes = sizes, sizes = sizes,
......
...@@ -247,7 +247,7 @@ pub fn is_metadata_route(mut route: &str) -> bool { ...@@ -247,7 +247,7 @@ pub fn is_metadata_route(mut route: &str) -> bool {
let mut page = route.to_string(); let mut page = route.to_string();
if !page.starts_with('/') { if !page.starts_with('/') {
page = format!("/{}", page); page = format!("/{page}");
} }
!page.ends_with("/page") && is_metadata_route_file(&page, &[], false) !page.ends_with("/page") && is_metadata_route_file(&page, &[], false)
......
...@@ -240,7 +240,7 @@ async fn dynamic_text_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<dy ...@@ -240,7 +240,7 @@ async fn dynamic_text_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<dy
}}) }})
}} }}
"#, "#,
resource_path = StringifyJs(&format!("./{}.{}", stem, ext)), resource_path = StringifyJs(&format!("./{stem}.{ext}")),
content_type = StringifyJs(&content_type), content_type = StringifyJs(&content_type),
file_type = StringifyJs(&stem), file_type = StringifyJs(&stem),
cache_control = StringifyJs(CACHE_HEADER_REVALIDATE), cache_control = StringifyJs(CACHE_HEADER_REVALIDATE),
...@@ -332,7 +332,7 @@ async fn dynamic_site_map_route_source( ...@@ -332,7 +332,7 @@ async fn dynamic_site_map_route_source(
{static_generation_code} {static_generation_code}
"#, "#,
resource_path = StringifyJs(&format!("./{}.{}", stem, ext)), resource_path = StringifyJs(&format!("./{stem}.{ext}")),
content_type = StringifyJs(&content_type), content_type = StringifyJs(&content_type),
file_type = StringifyJs(&stem), file_type = StringifyJs(&stem),
cache_control = StringifyJs(CACHE_HEADER_REVALIDATE), cache_control = StringifyJs(CACHE_HEADER_REVALIDATE),
...@@ -396,7 +396,7 @@ async fn dynamic_image_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<d ...@@ -396,7 +396,7 @@ async fn dynamic_image_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<d
return handler({{ params: restParams, id }}) return handler({{ params: restParams, id }})
}} }}
"#, "#,
resource_path = StringifyJs(&format!("./{}.{}", stem, ext)), resource_path = StringifyJs(&format!("./{stem}.{ext}")),
}; };
let file = File::from(code); let file = File::from(code);
......
...@@ -1118,7 +1118,7 @@ impl NextConfig { ...@@ -1118,7 +1118,7 @@ impl NextConfig {
let string = string.await?; let string = string.await?;
let mut jdeserializer = serde_json::Deserializer::from_str(&string); let mut jdeserializer = serde_json::Deserializer::from_str(&string);
let config: NextConfig = serde_path_to_error::deserialize(&mut jdeserializer) let config: NextConfig = serde_path_to_error::deserialize(&mut jdeserializer)
.with_context(|| format!("failed to parse next.config.js: {}", string))?; .with_context(|| format!("failed to parse next.config.js: {string}"))?;
Ok(config.cell()) Ok(config.cell())
} }
...@@ -1463,7 +1463,7 @@ impl NextConfig { ...@@ -1463,7 +1463,7 @@ impl NextConfig {
let this = self.await?; let this = self.await?;
match &this.deployment_id { match &this.deployment_id {
Some(deployment_id) => Ok(Vc::cell(Some(format!("?dpl={}", deployment_id).into()))), Some(deployment_id) => Ok(Vc::cell(Some(format!("?dpl={deployment_id}").into()))),
None => Ok(Vc::cell(None)), None => Ok(Vc::cell(None)),
} }
} }
...@@ -1617,7 +1617,7 @@ impl JsConfig { ...@@ -1617,7 +1617,7 @@ impl JsConfig {
pub async fn from_string(string: Vc<RcStr>) -> Result<Vc<Self>> { pub async fn from_string(string: Vc<RcStr>) -> Result<Vc<Self>> {
let string = string.await?; let string = string.await?;
let config: JsConfig = serde_json::from_str(&string) let config: JsConfig = serde_json::from_str(&string)
.with_context(|| format!("failed to parse next.config.js: {}", string))?; .with_context(|| format!("failed to parse next.config.js: {string}"))?;
Ok(config.cell()) Ok(config.cell())
} }
......
...@@ -39,7 +39,7 @@ pub async fn wrap_edge_entry( ...@@ -39,7 +39,7 @@ pub async fn wrap_edge_entry(
}}, }},
}}); }});
"#, "#,
StringifyJs(&format_args!("middleware_{}", pathname)) StringifyJs(&format_args!("middleware_{pathname}"))
); );
let file = File::from(source); let file = File::from(source);
......
...@@ -134,7 +134,7 @@ fn get_parametrized_route(route: &str) -> (String, FxHashMap<String, Group>) { ...@@ -134,7 +134,7 @@ fn get_parametrized_route(route: &str) -> (String, FxHashMap<String, Group>) {
pub fn get_route_regex(normalized_route: &str) -> RouteRegex { pub fn get_route_regex(normalized_route: &str) -> RouteRegex {
let (parameterized_route, groups) = get_parametrized_route(normalized_route); let (parameterized_route, groups) = get_parametrized_route(normalized_route);
RouteRegex { RouteRegex {
regex: format!("^{}(?:/)?$", parameterized_route), regex: format!("^{parameterized_route}(?:/)?$"),
groups, groups,
} }
} }
...@@ -175,7 +175,7 @@ fn get_safe_key_from_segment( ...@@ -175,7 +175,7 @@ fn get_safe_key_from_segment(
// the named regex // the named regex
let mut cleaned_key = key.replace(|c: char| !c.is_alphanumeric(), ""); let mut cleaned_key = key.replace(|c: char| !c.is_alphanumeric(), "");
if let Some(prefix) = key_prefix { if let Some(prefix) = key_prefix {
cleaned_key = format!("{}{}", prefix, cleaned_key); cleaned_key = format!("{prefix}{cleaned_key}");
} }
let mut invalid_key = false; let mut invalid_key = false;
...@@ -191,15 +191,15 @@ fn get_safe_key_from_segment( ...@@ -191,15 +191,15 @@ fn get_safe_key_from_segment(
cleaned_key = get_safe_route_key(); cleaned_key = get_safe_route_key();
} }
if let Some(prefix) = key_prefix { if let Some(prefix) = key_prefix {
route_keys.insert(cleaned_key.clone(), format!("{}{}", prefix, key)); route_keys.insert(cleaned_key.clone(), format!("{prefix}{key}"));
} else { } else {
route_keys.insert(cleaned_key.clone(), key); route_keys.insert(cleaned_key.clone(), key);
} }
match (repeat, optional) { match (repeat, optional) {
(true, true) => format!(r"(?:/(?P<{}>.+?))?", cleaned_key), (true, true) => format!(r"(?:/(?P<{cleaned_key}>.+?))?"),
(true, false) => format!(r"/(?P<{}>.+?)", cleaned_key), (true, false) => format!(r"/(?P<{cleaned_key}>.+?)"),
(false, true) => format!(r"(?:/(?P<{}>[^/]+?))?", cleaned_key), (false, true) => format!(r"(?:/(?P<{cleaned_key}>[^/]+?))?"),
(false, false) => format!(r"/(?P<{}>[^/]+?)", cleaned_key), (false, false) => format!(r"/(?P<{cleaned_key}>[^/]+?)"),
} }
} }
...@@ -254,7 +254,7 @@ pub fn get_named_route_regex(normalized_route: &str) -> NamedRouteRegex { ...@@ -254,7 +254,7 @@ pub fn get_named_route_regex(normalized_route: &str) -> NamedRouteRegex {
let regex = get_route_regex(normalized_route); let regex = get_route_regex(normalized_route);
NamedRouteRegex { NamedRouteRegex {
regex, regex,
named_regex: format!("^{}(?:/)?$", parameterized_route), named_regex: format!("^{parameterized_route}(?:/)?$"),
route_keys, route_keys,
} }
} }
...@@ -263,5 +263,5 @@ pub fn get_named_route_regex(normalized_route: &str) -> NamedRouteRegex { ...@@ -263,5 +263,5 @@ pub fn get_named_route_regex(normalized_route: &str) -> NamedRouteRegex {
/// This is intended to be using for build time only. /// This is intended to be using for build time only.
pub fn get_named_middleware_regex(normalized_route: &str) -> String { pub fn get_named_middleware_regex(normalized_route: &str) -> String {
let (parameterized_route, _route_keys) = get_named_parametrized_route(normalized_route, true); let (parameterized_route, _route_keys) = get_named_parametrized_route(normalized_route, true);
format!("^{}(?:/)?$", parameterized_route) format!("^{parameterized_route}(?:/)?$")
} }
...@@ -70,9 +70,8 @@ fn unsupported_module_source(root_path: Vc<FileSystemPath>, module: RcStr) -> Vc ...@@ -70,9 +70,8 @@ fn unsupported_module_source(root_path: Vc<FileSystemPath>, module: RcStr) -> Vc
}; };
let content = AssetContent::file(File::from(code).into()); let content = AssetContent::file(File::from(code).into());
VirtualSource::new_with_ident( VirtualSource::new_with_ident(
AssetIdent::from_path(root_path).with_modifier(Vc::cell( AssetIdent::from_path(root_path)
format!("unsupported edge import {}", module).into(), .with_modifier(Vc::cell(format!("unsupported edge import {module}").into())),
)),
content, content,
) )
} }
...@@ -124,13 +124,13 @@ impl NextFontGoogleReplacer { ...@@ -124,13 +124,13 @@ impl NextFontGoogleReplacer {
.weight .weight
.await? .await?
.as_ref() .as_ref()
.map(|w| format!("fontWeight: {},\n", w)) .map(|w| format!("fontWeight: {w},\n"))
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
properties properties
.style .style
.await? .await?
.as_ref() .as_ref()
.map(|s| format!("fontStyle: \"{}\",\n", s)) .map(|s| format!("fontStyle: \"{s}\",\n"))
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
) )
.into(), .into(),
...@@ -367,8 +367,8 @@ impl ImportMappingReplacement for NextFontGoogleFontFileReplacer { ...@@ -367,8 +367,8 @@ impl ImportMappingReplacement for NextFontGoogleFontFileReplacer {
name.push_str(".p") name.push_str(".p")
} }
let font_virtual_path = next_js_file_path("internal/font/google".into()) let font_virtual_path =
.join(format!("/{}.{}", name, ext).into()); next_js_file_path("internal/font/google".into()).join(format!("/{name}.{ext}").into());
// doesn't seem ideal to download the font into a string, but probably doesn't // doesn't seem ideal to download the font into a string, but probably doesn't
// really matter either. // really matter either.
...@@ -438,7 +438,7 @@ async fn update_google_stylesheet( ...@@ -438,7 +438,7 @@ async fn update_google_stylesheet(
stylesheet = stylesheet.replace( stylesheet = stylesheet.replace(
&font_url, &font_url,
&format!("{}?{}", GOOGLE_FONTS_INTERNAL_PREFIX, query_str), &format!("{GOOGLE_FONTS_INTERNAL_PREFIX}?{query_str}"),
) )
} }
...@@ -494,7 +494,7 @@ async fn get_stylesheet_url_from_options( ...@@ -494,7 +494,7 @@ async fn get_stylesheet_url_from_options(
let env = CommandLineProcessEnv::new(); let env = CommandLineProcessEnv::new();
if let Some(url) = &*env.read("TURBOPACK_TEST_ONLY_MOCK_SERVER".into()).await? { if let Some(url) = &*env.read("TURBOPACK_TEST_ONLY_MOCK_SERVER".into()).await? {
css_url = Some(format!("{}/css2", url)); css_url = Some(format!("{url}/css2"));
} }
} }
......
...@@ -151,13 +151,13 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin { ...@@ -151,13 +151,13 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin {
.weight .weight
.await? .await?
.as_ref() .as_ref()
.map(|w| format!("fontWeight: {},\n", w)) .map(|w| format!("fontWeight: {w},\n"))
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
properties properties
.style .style
.await? .await?
.as_ref() .as_ref()
.map(|s| format!("fontStyle: \"{}\",\n", s)) .map(|s| format!("fontStyle: \"{s}\",\n"))
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
); );
let js_asset = VirtualSource::new( let js_asset = VirtualSource::new(
...@@ -242,7 +242,7 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin { ...@@ -242,7 +242,7 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin {
name.push_str(".p") name.push_str(".p")
} }
let font_virtual_path = lookup_path.join(format!("/{}.{}", name, ext).into()); let font_virtual_path = lookup_path.join(format!("/{name}.{ext}").into());
let font_file = lookup_path.join(path.clone()).read(); let font_file = lookup_path.join(path.clone()).read();
......
...@@ -149,7 +149,7 @@ impl Display for FontWeight { ...@@ -149,7 +149,7 @@ impl Display for FontWeight {
f, f,
"{}", "{}",
match self { match self {
Self::Variable(start, end) => format!("{} {}", start, end), Self::Variable(start, end) => format!("{start} {end}"),
Self::Fixed(val) => val.to_string(), Self::Fixed(val) => val.to_string(),
} }
) )
...@@ -322,7 +322,7 @@ mod tests { ...@@ -322,7 +322,7 @@ mod tests {
); );
match request { match request {
Ok(r) => panic!("Expected failure, received {:?}", r), Ok(r) => panic!("Expected failure, received {r:?}"),
Err(err) => { Err(err) => {
assert!(err assert!(err
.to_string() .to_string()
......
...@@ -78,12 +78,12 @@ pub(super) async fn build_font_face_definitions( ...@@ -78,12 +78,12 @@ pub(super) async fn build_font_face_definitions(
.weight .weight
.as_ref() .as_ref()
.or(options.default_weight.as_ref()) .or(options.default_weight.as_ref())
.map_or_else(|| "".to_owned(), |w| format!("font-weight: {};", w)), .map_or_else(|| "".to_owned(), |w| format!("font-weight: {w};")),
&font &font
.style .style
.as_ref() .as_ref()
.or(options.default_style.as_ref()) .or(options.default_style.as_ref())
.map_or_else(|| "".to_owned(), |s| format!("font-style: {};", s)), .map_or_else(|| "".to_owned(), |s| format!("font-style: {s};")),
)); ));
} }
......
...@@ -67,13 +67,13 @@ pub(super) async fn build_font_class_rules( ...@@ -67,13 +67,13 @@ pub(super) async fn build_font_class_rules(
.weight .weight
.await? .await?
.as_ref() .as_ref()
.map(|w| format!("font-weight: {};\n", w)) .map(|w| format!("font-weight: {w};\n"))
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
css_properties css_properties
.style .style
.await? .await?
.as_ref() .as_ref()
.map(|s| format!("font-style: {};\n", s)) .map(|s| format!("font-style: {s};\n"))
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
); );
......
...@@ -56,7 +56,7 @@ pub(crate) async fn get_scoped_font_family( ...@@ -56,7 +56,7 @@ pub(crate) async fn get_scoped_font_family(
let font_family_base = font_family_name.await?.to_string(); let font_family_base = font_family_name.await?.to_string();
let font_family_name = match &*ty.await? { let font_family_name = match &*ty.await? {
FontFamilyType::WebFont => font_family_base, FontFamilyType::WebFont => font_family_base,
FontFamilyType::Fallback => format!("{} Fallback", font_family_base), FontFamilyType::Fallback => format!("{font_family_base} Fallback"),
}; };
Ok(Vc::cell(font_family_name.into())) Ok(Vc::cell(font_family_name.into()))
......
...@@ -462,6 +462,6 @@ pub fn get_client_reference_module_key(server_path: &str, export_name: &str) -> ...@@ -462,6 +462,6 @@ pub fn get_client_reference_module_key(server_path: &str, export_name: &str) ->
if export_name == "*" { if export_name == "*" {
server_path.into() server_path.into()
} else { } else {
format!("{}#{}", server_path, export_name).into() format!("{server_path}#{export_name}").into()
} }
} }
...@@ -85,7 +85,7 @@ impl Issue for InvalidImportModuleIssue { ...@@ -85,7 +85,7 @@ impl Issue for InvalidImportModuleIssue {
StyledString::Line( StyledString::Line(
messages messages
.iter() .iter()
.map(|v| StyledString::Text(format!("{}\n", v).into())) .map(|v| StyledString::Text(format!("{v}\n").into()))
.collect::<Vec<StyledString>>(), .collect::<Vec<StyledString>>(),
) )
.resolved_cell(), .resolved_cell(),
...@@ -374,7 +374,7 @@ impl BeforeResolvePlugin for ModuleFeatureReportResolvePlugin { ...@@ -374,7 +374,7 @@ impl BeforeResolvePlugin for ModuleFeatureReportResolvePlugin {
.find(|sub_path| path.is_match(sub_path)); .find(|sub_path| path.is_match(sub_path));
if let Some(sub_path) = sub_path { if let Some(sub_path) = sub_path {
ModuleFeatureTelemetry::new(format!("{}{}", module, sub_path).into(), 1) ModuleFeatureTelemetry::new(format!("{module}{sub_path}").into(), 1)
.resolved_cell() .resolved_cell()
.emit(); .emit();
} }
......
...@@ -92,7 +92,7 @@ impl ModularizeImportsTransformer { ...@@ -92,7 +92,7 @@ impl ModularizeImportsTransformer {
modularize_imports::Transform::Vec(v.clone()) modularize_imports::Transform::Vec(v.clone())
} }
Transform::None => { Transform::None => {
panic!("Missing transform value for package {}", k) panic!("Missing transform value for package {k}")
} }
}, },
prevent_full_import: v.prevent_full_import, prevent_full_import: v.prevent_full_import,
......
...@@ -92,11 +92,11 @@ impl CustomTransformer for NextPageStaticInfo { ...@@ -92,11 +92,11 @@ impl CustomTransformer for NextPageStaticInfo {
)]; )];
if let Some(runtime) = config_obj.get("runtime") { if let Some(runtime) = config_obj.get("runtime") {
messages.push(format!("- `export const runtime = {}`", runtime)); messages.push(format!("- `export const runtime = {runtime}`"));
} }
if let Some(regions) = config_obj.get("regions") { if let Some(regions) = config_obj.get("regions") {
messages.push(format!("- `export const preferredRegion = {}`", regions)); messages.push(format!("- `export const preferredRegion = {regions}`"));
} }
messages.push("Visit https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config for more information.".to_string()); messages.push("Visit https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config for more information.".to_string());
...@@ -164,7 +164,7 @@ impl Issue for PageStaticInfoIssue { ...@@ -164,7 +164,7 @@ impl Issue for PageStaticInfoIssue {
StyledString::Line( StyledString::Line(
self.messages self.messages
.iter() .iter()
.map(|v| StyledString::Text(format!("{}\n", v).into())) .map(|v| StyledString::Text(format!("{v}\n").into()))
.collect::<Vec<StyledString>>(), .collect::<Vec<StyledString>>(),
) )
.resolved_cell(), .resolved_cell(),
......
...@@ -71,7 +71,7 @@ pub async fn pathname_for_path( ...@@ -71,7 +71,7 @@ pub async fn pathname_for_path(
(PathType::Data, "") => "/index".into(), (PathType::Data, "") => "/index".into(),
// `get_path_to` always strips the leading `/` from the path, so we need to add // `get_path_to` always strips the leading `/` from the path, so we need to add
// it back here. // it back here.
(_, path) => format!("/{}", path).into(), (_, path) => format!("/{path}").into(),
}; };
Ok(Vc::cell(path)) Ok(Vc::cell(path))
...@@ -84,7 +84,7 @@ pub fn get_asset_prefix_from_pathname(pathname: &str) -> String { ...@@ -84,7 +84,7 @@ pub fn get_asset_prefix_from_pathname(pathname: &str) -> String {
if pathname == "/" { if pathname == "/" {
"/index".to_string() "/index".to_string()
} else if pathname == "/index" || pathname.starts_with("/index/") { } else if pathname == "/index" || pathname.starts_with("/index/") {
format!("/index{}", pathname) format!("/index{pathname}")
} else { } else {
pathname.to_string() pathname.to_string()
} }
...@@ -773,7 +773,7 @@ pub async fn load_next_js_template( ...@@ -773,7 +773,7 @@ pub async fn load_next_js_template(
// variable is missing, throw an error. // variable is missing, throw an error.
let mut replaced = FxIndexSet::default(); let mut replaced = FxIndexSet::default();
for (key, replacement) in &replacements { for (key, replacement) in &replacements {
let full = format!("'{}'", key); let full = format!("'{key}'");
if content.contains(&full) { if content.contains(&full) {
replaced.insert(*key); replaced.insert(*key);
...@@ -815,12 +815,12 @@ pub async fn load_next_js_template( ...@@ -815,12 +815,12 @@ pub async fn load_next_js_template(
// Replace the injections. // Replace the injections.
let mut injected = FxIndexSet::default(); let mut injected = FxIndexSet::default();
for (key, injection) in &injections { for (key, injection) in &injections {
let full = format!("// INJECT:{}", key); let full = format!("// INJECT:{key}");
if content.contains(&full) { if content.contains(&full) {
// Track all the injections to ensure that we're not missing any. // Track all the injections to ensure that we're not missing any.
injected.insert(*key); injected.insert(*key);
content = content.replace(&full, &format!("const {} = {}", key, injection)); content = content.replace(&full, &format!("const {key} = {injection}"));
} }
} }
...@@ -858,9 +858,9 @@ pub async fn load_next_js_template( ...@@ -858,9 +858,9 @@ pub async fn load_next_js_template(
// Replace the optional imports. // Replace the optional imports.
let mut imports_added = FxIndexSet::default(); let mut imports_added = FxIndexSet::default();
for (key, import_path) in &imports { for (key, import_path) in &imports {
let mut full = format!("// OPTIONAL_IMPORT:{}", key); let mut full = format!("// OPTIONAL_IMPORT:{key}");
let namespace = if !content.contains(&full) { let namespace = if !content.contains(&full) {
full = format!("// OPTIONAL_IMPORT:* as {}", key); full = format!("// OPTIONAL_IMPORT:* as {key}");
if content.contains(&full) { if content.contains(&full) {
true true
} else { } else {
...@@ -884,7 +884,7 @@ pub async fn load_next_js_template( ...@@ -884,7 +884,7 @@ pub async fn load_next_js_template(
), ),
); );
} else { } else {
content = content.replace(&full, &format!("const {} = null", key)); content = content.replace(&full, &format!("const {key} = null"));
} }
} }
......
...@@ -351,7 +351,7 @@ fn report_error(app_dir: &Option<PathBuf>, filepath: &str, error_kind: RSCErrorK ...@@ -351,7 +351,7 @@ fn report_error(app_dir: &Option<PathBuf>, filepath: &str, error_kind: RSCErrorK
vec![span], vec![span],
), ),
RSCErrorKind::NextRscErrIncompatibleRouteSegmentConfig(span, segment, property) => ( RSCErrorKind::NextRscErrIncompatibleRouteSegmentConfig(span, segment, property) => (
format!("Route segment config \"{}\" is not compatible with `nextConfig.{}`. Please remove it.", segment, property), format!("Route segment config \"{segment}\" is not compatible with `nextConfig.{property}`. Please remove it."),
vec![span], vec![span],
), ),
}; };
......
...@@ -21,7 +21,7 @@ use wasm_bindgen_futures::future_to_promise; ...@@ -21,7 +21,7 @@ use wasm_bindgen_futures::future_to_promise;
pub mod mdx; pub mod mdx;
fn convert_err(err: Error) -> JsValue { fn convert_err(err: Error) -> JsValue {
format!("{:?}", err).into() format!("{err:?}").into()
} }
#[wasm_bindgen(js_name = "minifySync")] #[wasm_bindgen(js_name = "minifySync")]
......
[toolchain] [toolchain]
channel = "nightly-2025-04-14" channel = "nightly-2025-05-12"
components = ["rustfmt", "clippy", "rust-analyzer"] components = ["rustfmt", "clippy", "rust-analyzer"]
profile = "minimal" profile = "minimal"
...@@ -92,7 +92,7 @@ impl EsRegex { ...@@ -92,7 +92,7 @@ impl EsRegex {
} }
let regex = if !applied_flags.is_empty() { let regex = if !applied_flags.is_empty() {
regex::Regex::new(&format!("(?{}){}", applied_flags, pattern)) regex::Regex::new(&format!("(?{applied_flags}){pattern}"))
} else { } else {
regex::Regex::new(&pattern) regex::Regex::new(&pattern)
}; };
......
...@@ -364,7 +364,7 @@ mod tests { ...@@ -364,7 +364,7 @@ mod tests {
swap(&mut warm_keys[i], &mut keys[j]); swap(&mut warm_keys[i], &mut keys[j]);
} }
} }
println!("Number of compactions: {}", number_of_compactions); println!("Number of compactions: {number_of_compactions}");
assert!(containers.len() < 40); assert!(containers.len() < 40);
let coverage = total_coverage(&containers, (0, 10000)); let coverage = total_coverage(&containers, (0, 10000));
......
...@@ -258,8 +258,8 @@ impl TurboPersistence { ...@@ -258,8 +258,8 @@ impl TurboPersistence {
while !content.is_empty() { while !content.is_empty() {
let seq = content.read_u32::<BE>()?; let seq = content.read_u32::<BE>()?;
deleted_files.insert(seq); deleted_files.insert(seq);
let sst_file = self.path.join(format!("{:08}.sst", seq)); let sst_file = self.path.join(format!("{seq:08}.sst"));
let blob_file = self.path.join(format!("{:08}.blob", seq)); let blob_file = self.path.join(format!("{seq:08}.blob"));
for path in [sst_file, blob_file] { for path in [sst_file, blob_file] {
if fs::exists(&path)? { if fs::exists(&path)? {
fs::remove_file(path)?; fs::remove_file(path)?;
...@@ -336,14 +336,14 @@ impl TurboPersistence { ...@@ -336,14 +336,14 @@ impl TurboPersistence {
/// Opens a single SST file. This memory maps the file, but doesn't read it yet. /// Opens a single SST file. This memory maps the file, but doesn't read it yet.
fn open_sst(&self, seq: u32) -> Result<StaticSortedFile> { fn open_sst(&self, seq: u32) -> Result<StaticSortedFile> {
let path = self.path.join(format!("{:08}.sst", seq)); let path = self.path.join(format!("{seq:08}.sst"));
StaticSortedFile::open(seq, path) StaticSortedFile::open(seq, path)
.with_context(|| format!("Unable to open sst file {:08}.sst", seq)) .with_context(|| format!("Unable to open sst file {seq:08}.sst"))
} }
/// Reads and decompresses a blob file. This is not backed by any cache. /// Reads and decompresses a blob file. This is not backed by any cache.
fn read_blob(&self, seq: u32) -> Result<ArcSlice<u8>> { fn read_blob(&self, seq: u32) -> Result<ArcSlice<u8>> {
let path = self.path.join(format!("{:08}.blob", seq)); let path = self.path.join(format!("{seq:08}.blob"));
let mmap = unsafe { Mmap::map(&File::open(&path)?)? }; let mmap = unsafe { Mmap::map(&File::open(&path)?)? };
#[cfg(unix)] #[cfg(unix)]
mmap.advise(memmap2::Advice::Sequential)?; mmap.advise(memmap2::Advice::Sequential)?;
...@@ -488,7 +488,7 @@ impl TurboPersistence { ...@@ -488,7 +488,7 @@ impl TurboPersistence {
for seq in removed_ssts.iter() { for seq in removed_ssts.iter() {
buf.write_u32::<BE>(*seq)?; buf.write_u32::<BE>(*seq)?;
} }
let mut file = File::create(self.path.join(format!("{:08}.del", seq)))?; let mut file = File::create(self.path.join(format!("{seq:08}.del")))?;
file.write_all(&buf)?; file.write_all(&buf)?;
file.sync_all()?; file.sync_all()?;
} }
...@@ -507,9 +507,9 @@ impl TurboPersistence { ...@@ -507,9 +507,9 @@ impl TurboPersistence {
{ {
let mut log = self.open_log()?; let mut log = self.open_log()?;
writeln!(log, "Time {}", time)?; writeln!(log, "Time {time}")?;
let span = time.until(Timestamp::now())?; let span = time.until(Timestamp::now())?;
writeln!(log, "Commit {seq:08} {:#}", span)?; writeln!(log, "Commit {seq:08} {span:#}")?;
for (index, family, min, max, size) in new_sst_info.iter() { for (index, family, min, max, size) in new_sst_info.iter() {
writeln!( writeln!(
log, log,
...@@ -522,10 +522,10 @@ impl TurboPersistence { ...@@ -522,10 +522,10 @@ impl TurboPersistence {
)?; )?;
} }
for (seq, _) in new_blob_files.iter() { for (seq, _) in new_blob_files.iter() {
writeln!(log, "{:08} BLOB", seq)?; writeln!(log, "{seq:08} BLOB")?;
} }
for index in indicies_to_delete.iter() { for index in indicies_to_delete.iter() {
writeln!(log, "{:08} DELETED", index)?; writeln!(log, "{index:08} DELETED")?;
} }
} }
...@@ -735,7 +735,7 @@ impl TurboPersistence { ...@@ -735,7 +735,7 @@ impl TurboPersistence {
total_key_size, total_key_size,
total_value_size, total_value_size,
)?; )?;
Ok((seq, builder.write(&path.join(format!("{:08}.sst", seq)))?)) Ok((seq, builder.write(&path.join(format!("{seq:08}.sst")))?))
} }
let mut new_sst_files = Vec::new(); let mut new_sst_files = Vec::new();
...@@ -881,7 +881,7 @@ impl TurboPersistence { ...@@ -881,7 +881,7 @@ impl TurboPersistence {
let index = ssts_with_ranges[index].index; let index = ssts_with_ranges[index].index;
let sst = &static_sorted_files[index]; let sst = &static_sorted_files[index];
let src_path = self.path.join(format!("{:08}.sst", sst.sequence_number())); let src_path = self.path.join(format!("{:08}.sst", sst.sequence_number()));
let dst_path = self.path.join(format!("{:08}.sst", seq)); let dst_path = self.path.join(format!("{seq:08}.sst"));
if fs::hard_link(&src_path, &dst_path).is_err() { if fs::hard_link(&src_path, &dst_path).is_err() {
fs::copy(src_path, &dst_path)?; fs::copy(src_path, &dst_path)?;
} }
......
...@@ -388,7 +388,7 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> { ...@@ -388,7 +388,7 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> {
lz4::compress_to_vec(value, &mut buffer, ACC_LEVEL_DEFAULT) lz4::compress_to_vec(value, &mut buffer, ACC_LEVEL_DEFAULT)
.context("Compression of value for blob file failed")?; .context("Compression of value for blob file failed")?;
let file = self.path.join(format!("{:08}.blob", seq)); let file = self.path.join(format!("{seq:08}.blob"));
let mut file = File::create(&file).context("Unable to create blob file")?; let mut file = File::create(&file).context("Unable to create blob file")?;
file.write_all(&buffer) file.write_all(&buffer)
.context("Unable to write blob file")?; .context("Unable to write blob file")?;
...@@ -410,10 +410,10 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> { ...@@ -410,10 +410,10 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> {
let builder = let builder =
StaticSortedFileBuilder::new(family, entries, total_key_size, total_value_size)?; StaticSortedFileBuilder::new(family, entries, total_key_size, total_value_size)?;
let path = self.path.join(format!("{:08}.sst", seq)); let path = self.path.join(format!("{seq:08}.sst"));
let file = builder let file = builder
.write(&path) .write(&path)
.with_context(|| format!("Unable to write SST file {:08}.sst", seq))?; .with_context(|| format!("Unable to write SST file {seq:08}.sst"))?;
#[cfg(feature = "verify_sst_content")] #[cfg(feature = "verify_sst_content")]
{ {
......
...@@ -281,7 +281,7 @@ fn write_dep_tree( ...@@ -281,7 +281,7 @@ fn write_dep_tree(
ident.name, ident.name,
ident.path, ident.path,
ident.range.start.line, ident.range.start.line,
tags.iter().map(|t| format!("\"{}\"", t)).join(",") tags.iter().map(|t| format!("\"{t}\"")).join(",")
); );
node_ids.insert(ident, counter); node_ids.insert(ident, counter);
} }
...@@ -297,6 +297,6 @@ fn write_dep_tree( ...@@ -297,6 +297,6 @@ fn write_dep_tree(
let src_id = *node_ids.get(src).unwrap(); let src_id = *node_ids.get(src).unwrap();
let dst_id = *node_ids.get(dest).unwrap(); let dst_id = *node_ids.get(dest).unwrap();
_ = writeln!(file, "CREATE (n_{})-[:{}]->(n_{})", src_id, style, dst_id,); _ = writeln!(file, "CREATE (n_{src_id})-[:{style}]->(n_{dst_id})",);
} }
} }
...@@ -534,10 +534,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> { ...@@ -534,10 +534,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
get!(task, Activeness).unwrap() get!(task, Activeness).unwrap()
}; };
let listener = root.all_clean_event.listen_with_note(move || { let listener = root.all_clean_event.listen_with_note(move || {
format!( format!("try_read_task_output (strongly consistent) from {reader:?}")
"try_read_task_output (strongly consistent) from {:?}",
reader
)
}); });
drop(task); drop(task);
if !task_ids_to_schedule.is_empty() { if !task_ids_to_schedule.is_empty() {
...@@ -954,7 +951,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> { ...@@ -954,7 +951,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
persisted_task_cache_log, persisted_task_cache_log,
task_snapshots, task_snapshots,
) { ) {
println!("Persisting failed: {:?}", err); println!("Persisting failed: {err:?}");
return None; return None;
} }
} }
...@@ -989,7 +986,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> { ...@@ -989,7 +986,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
fn stop(&self) { fn stop(&self) {
if let Err(err) = self.backing_storage.shutdown() { if let Err(err) = self.backing_storage.shutdown() {
println!("Shutting down failed: {}", err); println!("Shutting down failed: {err}");
} }
} }
......
...@@ -451,7 +451,7 @@ impl<B: BackingStorage> Debug for TaskGuardImpl<'_, B> { ...@@ -451,7 +451,7 @@ impl<B: BackingStorage> Debug for TaskGuardImpl<'_, B> {
d.field("task_type", &task_type); d.field("task_type", &task_type);
}; };
for (key, value) in self.task.iter_all() { for (key, value) in self.task.iter_all() {
d.field(&format!("{:?}", key), &value); d.field(&format!("{key:?}"), &value);
} }
d.finish() d.finish()
} }
......
...@@ -60,10 +60,11 @@ impl UpdateOutputOperation { ...@@ -60,10 +60,11 @@ impl UpdateOutputOperation {
// Skip updating the output when the task is stale // Skip updating the output when the task is stale
return; return;
} }
let children = ctx let children = if ctx.should_track_children() {
.should_track_children() new_children.iter().copied().collect()
.then(|| new_children.iter().copied().collect()) } else {
.unwrap_or_default(); Default::default()
};
let old_error = task.remove(&CachedDataItemKey::Error {}); let old_error = task.remove(&CachedDataItemKey::Error {});
let current_output = get!(task, Output); let current_output = get!(task, Output);
...@@ -118,10 +119,11 @@ impl UpdateOutputOperation { ...@@ -118,10 +119,11 @@ impl UpdateOutputOperation {
value: output_value, value: output_value,
}); });
let dependent_tasks = ctx let dependent_tasks = if ctx.should_track_dependencies() {
.should_track_dependencies() get_many!(task, OutputDependent { task } => task)
.then(|| get_many!(task, OutputDependent { task } => task)) } else {
.unwrap_or_default(); Default::default()
};
let mut queue = AggregationUpdateQueue::new(); let mut queue = AggregationUpdateQueue::new();
......
...@@ -95,9 +95,7 @@ impl ActivenessState { ...@@ -95,9 +95,7 @@ impl ActivenessState {
active_counter: 0, active_counter: 0,
root_ty: None, root_ty: None,
active_until_clean: false, active_until_clean: false,
all_clean_event: Event::new(move || { all_clean_event: Event::new(move || format!("ActivenessState::all_clean_event {id:?}")),
format!("ActivenessState::all_clean_event {:?}", id)
}),
} }
} }
...@@ -345,9 +343,7 @@ impl Eq for InProgressCellState {} ...@@ -345,9 +343,7 @@ impl Eq for InProgressCellState {}
impl InProgressCellState { impl InProgressCellState {
pub fn new(task_id: TaskId, cell: CellId) -> Self { pub fn new(task_id: TaskId, cell: CellId) -> Self {
InProgressCellState { InProgressCellState {
event: Event::new(move || { event: Event::new(move || format!("InProgressCellState::event ({task_id} {cell:?})")),
format!("InProgressCellState::event ({} {:?})", task_id, cell)
}),
} }
} }
} }
......
...@@ -137,7 +137,7 @@ pub fn generate_register() { ...@@ -137,7 +137,7 @@ pub fn generate_register() {
ctx.process_item(&item).unwrap(); ctx.process_item(&item).unwrap();
} }
} }
Err(err) => println!("{}", err), Err(err) => println!("{err}"),
} }
} }
...@@ -461,8 +461,7 @@ impl RegisterContext<'_> { ...@@ -461,8 +461,7 @@ impl RegisterContext<'_> {
assert!( assert!(
self.values.insert(key, value).is_none(), self.values.insert(key, value).is_none(),
"{} is declared more than once", "{ident} is declared more than once"
ident
); );
} }
......
...@@ -196,20 +196,17 @@ impl Issue for FetchIssue { ...@@ -196,20 +196,17 @@ impl Issue for FetchIssue {
Ok(Vc::cell(Some( Ok(Vc::cell(Some(
StyledString::Text(match kind { StyledString::Text(match kind {
FetchErrorKind::Connect => format!( FetchErrorKind::Connect => {
"There was an issue establishing a connection while requesting {}.", format!("There was an issue establishing a connection while requesting {url}.")
url .into()
) }
.into(), FetchErrorKind::Status(status) => {
FetchErrorKind::Status(status) => format!( format!("Received response with status {status} when requesting {url}").into()
"Received response with status {} when requesting {}", }
status, url
)
.into(),
FetchErrorKind::Timeout => { FetchErrorKind::Timeout => {
format!("Connection timed out when requesting {}", url).into() format!("Connection timed out when requesting {url}").into()
} }
FetchErrorKind::Other => format!("There was an issue requesting {}", url).into(), FetchErrorKind::Other => format!("There was an issue requesting {url}").into(),
}) })
.resolved_cell(), .resolved_cell(),
))) )))
......
...@@ -100,7 +100,7 @@ async fn hash_directory(directory: Vc<FileSystemPath>) -> Result<Vc<RcStr>> { ...@@ -100,7 +100,7 @@ async fn hash_directory(directory: Vc<FileSystemPath>) -> Result<Vc<RcStr>> {
.join(",") .join(",")
.as_bytes(), .as_bytes(),
); );
println!("hash_directory({})", dir_path); println!("hash_directory({dir_path})");
Ok(hash) Ok(hash)
} }
......
...@@ -156,7 +156,7 @@ impl ValueToString for AttachedFileSystem { ...@@ -156,7 +156,7 @@ impl ValueToString for AttachedFileSystem {
let root_fs_str = self.root_fs.to_string().await?; let root_fs_str = self.root_fs.to_string().await?;
let child_fs_str = self.child_fs.to_string().await?; let child_fs_str = self.child_fs.to_string().await?;
Ok(Vc::cell( Ok(Vc::cell(
format!("{}-with-{}", root_fs_str, child_fs_str).into(), format!("{root_fs_str}-with-{child_fs_str}").into(),
)) ))
} }
} }
...@@ -57,7 +57,7 @@ impl UnparseableJson { ...@@ -57,7 +57,7 @@ impl UnparseableJson {
pub fn write_with_content(&self, writer: &mut impl Write, text: &str) -> std::fmt::Result { pub fn write_with_content(&self, writer: &mut impl Write, text: &str) -> std::fmt::Result {
writeln!(writer, "{}", self.message)?; writeln!(writer, "{}", self.message)?;
if let Some(path) = &self.path { if let Some(path) = &self.path {
writeln!(writer, " at {}", path)?; writeln!(writer, " at {path}")?;
} }
match (self.start_location, self.end_location) { match (self.start_location, self.end_location) {
(Some((line, column)), Some((end_line, end_column))) => { (Some((line, column)), Some((end_line, end_column))) => {
...@@ -92,7 +92,7 @@ impl Display for UnparseableJson { ...@@ -92,7 +92,7 @@ impl Display for UnparseableJson {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.message)?; write!(f, "{}", self.message)?;
if let Some(path) = &self.path { if let Some(path) = &self.path {
write!(f, " at {}", path)?; write!(f, " at {path}")?;
} }
Ok(()) Ok(())
} }
......
...@@ -489,7 +489,7 @@ fn format_absolute_fs_path(path: &Path, name: &str, root_path: &Path) -> Option< ...@@ -489,7 +489,7 @@ fn format_absolute_fs_path(path: &Path, name: &str, root_path: &Path) -> Option<
let path = if let Ok(rel_path) = path.strip_prefix(root_path) { let path = if let Ok(rel_path) = path.strip_prefix(root_path) {
let path = if MAIN_SEPARATOR != '/' { let path = if MAIN_SEPARATOR != '/' {
let rel_path = rel_path.to_string_lossy().replace(MAIN_SEPARATOR, "/"); let rel_path = rel_path.to_string_lossy().replace(MAIN_SEPARATOR, "/");
format!("[{name}]/{}", rel_path) format!("[{name}]/{rel_path}")
} else { } else {
format!("[{name}]/{}", rel_path.display()) format!("[{name}]/{}", rel_path.display())
}; };
...@@ -932,7 +932,7 @@ impl FileSystem for DiskFileSystem { ...@@ -932,7 +932,7 @@ impl FileSystem for DiskFileSystem {
} }
}) })
.await .await
.with_context(|| format!("create symlink to {}", target))?; .with_context(|| format!("create symlink to {target}"))?;
} }
LinkContent::Invalid => { LinkContent::Invalid => {
anyhow::bail!("invalid symlink target: {}", full_path.display()) anyhow::bail!("invalid symlink target: {}", full_path.display())
...@@ -1161,13 +1161,12 @@ impl FileSystemPath { ...@@ -1161,13 +1161,12 @@ impl FileSystemPath {
// provided by the user, so we allow it. // provided by the user, so we allow it.
debug_assert!( debug_assert!(
MAIN_SEPARATOR != '\\' || !path.contains('\\'), MAIN_SEPARATOR != '\\' || !path.contains('\\'),
"path {} must not contain a Windows directory '\\', it must be normalized to Unix '/'", "path {path} must not contain a Windows directory '\\', it must be normalized to Unix \
path, '/'",
); );
debug_assert!( debug_assert!(
normalize_path(&path).as_deref() == Some(&*path), normalize_path(&path).as_deref() == Some(&*path),
"path {} must be normalized", "path {path} must be normalized",
path,
); );
Self::cell(FileSystemPath { fs, path }) Self::cell(FileSystemPath { fs, path })
} }
...@@ -1221,7 +1220,7 @@ impl FileSystemPath { ...@@ -1221,7 +1220,7 @@ impl FileSystemPath {
if let (path, Some(ext)) = this.split_extension() { if let (path, Some(ext)) = this.split_extension() {
return Ok(Self::new_normalized( return Ok(Self::new_normalized(
*this.fs, *this.fs,
format!("{}{}.{}", path, appending, ext).into(), format!("{path}{appending}.{ext}").into(),
)); ));
} }
Ok(Self::new_normalized( Ok(Self::new_normalized(
...@@ -1956,7 +1955,7 @@ mod mime_option_serde { ...@@ -1956,7 +1955,7 @@ mod mime_option_serde {
} else { } else {
Mime::from_str(value) Mime::from_str(value)
.map(Some) .map(Some)
.map_err(|e| E::custom(format!("{}", e))) .map_err(|e| E::custom(format!("{e}")))
} }
} }
} }
......
...@@ -94,7 +94,7 @@ pub struct SourceContextLines<'a>(pub Vec<SourceContextLine<'a>>); ...@@ -94,7 +94,7 @@ pub struct SourceContextLines<'a>(pub Vec<SourceContextLine<'a>>);
impl Display for SourceContextLines<'_> { impl Display for SourceContextLines<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for line in &self.0 { for line in &self.0 {
write!(f, "{}", line)?; write!(f, "{line}")?;
} }
Ok(()) Ok(())
} }
...@@ -129,7 +129,7 @@ pub fn get_source_context<'a>( ...@@ -129,7 +129,7 @@ pub fn get_source_context<'a>(
} }
let (a, b) = s.split_at(s.floor_char_boundary(98)); let (a, b) = s.split_at(s.floor_char_boundary(98));
let (_, c) = b.split_at(b.ceil_char_boundary(b.len() - 99)); let (_, c) = b.split_at(b.ceil_char_boundary(b.len() - 99));
Cow::Owned(format!("{}...{}", a, c)) Cow::Owned(format!("{a}...{c}"))
} }
match (i.cmp(&start_line), i.cmp(&end_line)) { match (i.cmp(&start_line), i.cmp(&end_line)) {
// outside // outside
......
...@@ -19,9 +19,8 @@ pub fn join_path(fs_path: &str, join: &str) -> Option<String> { ...@@ -19,9 +19,8 @@ pub fn join_path(fs_path: &str, join: &str) -> Option<String> {
// backslash. // backslash.
debug_assert!( debug_assert!(
!join.contains('\\'), !join.contains('\\'),
"joined path {} must not contain a Windows directory '\\', it must be normalized to Unix \ "joined path {join} must not contain a Windows directory '\\', it must be normalized to \
'/'", Unix '/'"
join
); );
// TODO: figure out why this freezes the benchmarks. // TODO: figure out why this freezes the benchmarks.
......
...@@ -427,8 +427,7 @@ impl DiskWatcher { ...@@ -427,8 +427,7 @@ impl DiskWatcher {
// notify or system weirdness. // notify or system weirdness.
panic!( panic!(
"Rename event does not contain source and destination \ "Rename event does not contain source and destination \
paths {:#?}", paths {paths:#?}"
paths
); );
} }
} }
...@@ -455,7 +454,7 @@ impl DiskWatcher { ...@@ -455,7 +454,7 @@ impl DiskWatcher {
} }
// Error raised by notify watcher itself // Error raised by notify watcher itself
Ok(Err(notify::Error { kind, paths })) => { Ok(Err(notify::Error { kind, paths })) => {
println!("watch error ({:?}): {:?} ", paths, kind); println!("watch error ({paths:?}): {kind:?} ");
if paths.is_empty() { if paths.is_empty() {
batched_invalidate_path_and_children batched_invalidate_path_and_children
......
...@@ -157,7 +157,7 @@ pub fn generate_destructuring<'a, I: Fn(&Field) -> bool>( ...@@ -157,7 +157,7 @@ pub fn generate_destructuring<'a, I: Fn(&Field) -> bool>(
.map(|(i, field)| match &field.ident { .map(|(i, field)| match &field.ident {
Some(ident) => (quote! { #ident }, quote! { #ident }), Some(ident) => (quote! { #ident }, quote! { #ident }),
None => { None => {
let ident = Ident::new(&format!("field_{}", i), field.span()); let ident = Ident::new(&format!("field_{i}"), field.span());
let index = syn::Index::from(i); let index = syn::Index::from(i);
(quote! { #index: #ident }, quote! { #ident }) (quote! { #index: #ident }, quote! { #ident })
} }
......
...@@ -92,7 +92,7 @@ impl Parse for ValueImplArguments { ...@@ -92,7 +92,7 @@ impl Parse for ValueImplArguments {
(_, meta) => { (_, meta) => {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&meta, &meta,
format!("unexpected {:?}, expected \"ident\"", meta), format!("unexpected {meta:?}, expected \"ident\""),
)) ))
} }
} }
...@@ -241,7 +241,7 @@ pub fn value_impl(args: TokenStream, input: TokenStream) -> TokenStream { ...@@ -241,7 +241,7 @@ pub fn value_impl(args: TokenStream, input: TokenStream) -> TokenStream {
let inline_function_ident = turbo_fn.inline_ident(); let inline_function_ident = turbo_fn.inline_ident();
let inline_extension_trait_ident = Ident::new( let inline_extension_trait_ident = Ident::new(
&format!("{}_{}_{}_inline", ty_ident, trait_ident, ident), &format!("{ty_ident}_{trait_ident}_{ident}_inline"),
ident.span(), ident.span(),
); );
let (inline_signature, inline_block) = let (inline_signature, inline_block) =
......
...@@ -199,9 +199,9 @@ impl Parse for ValueArguments { ...@@ -199,9 +199,9 @@ impl Parse for ValueArguments {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&meta, &meta,
format!( format!(
"unexpected {:?}, expected \"shared\", \"into\", \"serialization\", \ "unexpected {meta:?}, expected \"shared\", \"into\", \
\"cell\", \"eq\", \"transparent\", or \"operation\"", \"serialization\", \"cell\", \"eq\", \"transparent\", or \
meta \"operation\""
), ),
)) ))
} }
...@@ -255,8 +255,7 @@ pub fn value(args: TokenStream, input: TokenStream) -> TokenStream { ...@@ -255,8 +255,7 @@ pub fn value(args: TokenStream, input: TokenStream) -> TokenStream {
// the leading whitespace. // the leading whitespace.
let doc_str = format!( let doc_str = format!(
"\n\nThis is a [transparent value type][turbo_tasks::value#transparent] \ "\n\nThis is a [transparent value type][turbo_tasks::value#transparent] \
wrapping [`{}`].", wrapping [`{inner_type_string}`].",
inner_type_string,
); );
attrs.push(parse_quote! { attrs.push(parse_quote! {
......
...@@ -110,7 +110,7 @@ pub fn value_trait(args: TokenStream, input: TokenStream) -> TokenStream { ...@@ -110,7 +110,7 @@ pub fn value_trait(args: TokenStream, input: TokenStream) -> TokenStream {
let is_self_used = is_self_used(default); let is_self_used = is_self_used(default);
let inline_function_ident = turbo_fn.inline_ident(); let inline_function_ident = turbo_fn.inline_ident();
let inline_extension_trait_ident = let inline_extension_trait_ident =
Ident::new(&format!("{}_{}_inline", trait_ident, ident), ident.span()); Ident::new(&format!("{trait_ident}_{ident}_inline"), ident.span());
let (inline_signature, inline_block) = let (inline_signature, inline_block) =
turbo_fn.inline_signature_and_block(default, is_self_used); turbo_fn.inline_signature_and_block(default, is_self_used);
let inline_attrs = filter_inline_attributes(&attrs[..]); let inline_attrs = filter_inline_attributes(&attrs[..]);
......
...@@ -217,7 +217,7 @@ fn fuzzy_loom_new() { ...@@ -217,7 +217,7 @@ fn fuzzy_loom_new() {
for size in [10, 20] { for size in [10, 20] {
for _ in 0..1000 { for _ in 0..1000 {
let seed = rand::random(); let seed = rand::random();
println!("Seed {} Size {}", seed, size); println!("Seed {seed} Size {size}");
fuzzy_loom(seed, size); fuzzy_loom(seed, size);
} }
} }
......
...@@ -86,11 +86,8 @@ fn check_invariants(ctx: &NodeAggregationContext<'_>, node_ids: impl IntoIterato ...@@ -86,11 +86,8 @@ fn check_invariants(ctx: &NodeAggregationContext<'_>, node_ids: impl IntoIterato
|| aggregation_number == u32::MAX; || aggregation_number == u32::MAX;
if !condition { if !condition {
let msg = format!( let msg = format!(
"follower #{} {} -> #{} {}", "follower #{node_value} {aggregation_number} -> #{follower_value} \
node_value, {follower_aggregation_number}"
aggregation_number,
follower_value,
follower_aggregation_number
); );
print(ctx, &find_root(node_id.clone()), true); print(ctx, &find_root(node_id.clone()), true);
panic!("{msg}"); panic!("{msg}");
...@@ -120,8 +117,8 @@ fn check_invariants(ctx: &NodeAggregationContext<'_>, node_ids: impl IntoIterato ...@@ -120,8 +117,8 @@ fn check_invariants(ctx: &NodeAggregationContext<'_>, node_ids: impl IntoIterato
upper.guard.value upper.guard.value
}; };
let msg = format!( let msg = format!(
"follower #{} -> #{} is not connected to upper #{}", "follower #{node_value} -> #{follower_value} is not connected to \
node_value, follower_value, upper_value, upper #{upper_value}",
); );
print(ctx, &find_root(node_id.clone()), true); print(ctx, &find_root(node_id.clone()), true);
panic!("{msg}"); panic!("{msg}");
...@@ -193,10 +190,7 @@ fn print_graph<C: AggregationContext>( ...@@ -193,10 +190,7 @@ fn print_graph<C: AggregationContext>(
drop(node); drop(node);
if show_internal { if show_internal {
println!( println!("\"{name}\" [label=\"{name}\\n{n}\", style=filled, fillcolor=\"{color}\"];");
"\"{}\" [label=\"{}\\n{}\", style=filled, fillcolor=\"{}\"];",
name, name, n, color
);
} else { } else {
println!( println!(
"\"{}\" [label=\"{}\\n{}\\n{}U {}F\", style=filled, fillcolor=\"{}\"];", "\"{}\" [label=\"{}\\n{}\\n{}U {}F\", style=filled, fillcolor=\"{}\"];",
...@@ -211,7 +205,7 @@ fn print_graph<C: AggregationContext>( ...@@ -211,7 +205,7 @@ fn print_graph<C: AggregationContext>(
for child_id in children { for child_id in children {
let child_name = name_fn(&child_id); let child_name = name_fn(&child_id);
println!("\"{}\" -> \"{}\";", name, child_name); println!("\"{name}\" -> \"{child_name}\";");
if visited.insert(child_id.clone()) { if visited.insert(child_id.clone()) {
queue.push(child_id); queue.push(child_id);
} }
...@@ -219,20 +213,14 @@ fn print_graph<C: AggregationContext>( ...@@ -219,20 +213,14 @@ fn print_graph<C: AggregationContext>(
if show_internal { if show_internal {
for upper_id in uppers { for upper_id in uppers {
let upper_name = name_fn(&upper_id); let upper_name = name_fn(&upper_id);
println!( println!("\"{name}\" -> \"{upper_name}\" [style=dashed, color=green];");
"\"{}\" -> \"{}\" [style=dashed, color=green];",
name, upper_name
);
if visited.insert(upper_id.clone()) { if visited.insert(upper_id.clone()) {
queue.push(upper_id); queue.push(upper_id);
} }
} }
for follower_id in followers { for follower_id in followers {
let follower_name = name_fn(&follower_id); let follower_name = name_fn(&follower_id);
println!( println!("\"{name}\" -> \"{follower_name}\" [style=dashed, color=red];");
"\"{}\" -> \"{}\" [style=dashed, color=red];",
name, follower_name
);
if visited.insert(follower_id.clone()) { if visited.insert(follower_id.clone()) {
queue.push(follower_id); queue.push(follower_id);
} }
...@@ -805,7 +793,7 @@ fn performance( ...@@ -805,7 +793,7 @@ fn performance(
let n = guard.aggregation_node.aggregation_number(); let n = guard.aggregation_node.aggregation_number();
let f = guard.aggregation_node.followers().map_or(0, |f| f.len()); let f = guard.aggregation_node.followers().map_or(0, |f| f.len());
let u = guard.aggregation_node.uppers().len(); let u = guard.aggregation_node.uppers().len();
print!(" -> {} [{}U {}F]", n, u, f); print!(" -> {n} [{u}U {f}F]");
if guard.children.is_empty() { if guard.children.is_empty() {
break; break;
} }
...@@ -868,7 +856,7 @@ fn performance( ...@@ -868,7 +856,7 @@ fn performance(
node.add_child_unchecked(&ctx, inner_node.clone()); node.add_child_unchecked(&ctx, inner_node.clone());
} }
let root_duration = start.elapsed(); let root_duration = start.elapsed();
println!("Root: {:?}", root_duration); println!("Root: {root_duration:?}");
// Add another child // Add another child
let start = Instant::now(); let start = Instant::now();
...@@ -877,7 +865,7 @@ fn performance( ...@@ -877,7 +865,7 @@ fn performance(
inner_node.add_child_unchecked(&ctx, node.clone()); inner_node.add_child_unchecked(&ctx, node.clone());
} }
let child_duration = start.elapsed(); let child_duration = start.elapsed();
println!("Child: {:?}", child_duration); println!("Child: {child_duration:?}");
print_aggregation_numbers(inner_node.clone()); print_aggregation_numbers(inner_node.clone());
...@@ -922,7 +910,7 @@ fn many_children() { ...@@ -922,7 +910,7 @@ fn many_children() {
inner_node.add_child_unchecked(&ctx, node.clone()); inner_node.add_child_unchecked(&ctx, node.clone());
} }
let children_duration = start.elapsed(); let children_duration = start.elapsed();
println!("Children: {:?}", children_duration); println!("Children: {children_duration:?}");
for j in 0.. { for j in 0.. {
let start = Instant::now(); let start = Instant::now();
for i in 0..CHILDREN { for i in 0..CHILDREN {
...@@ -931,7 +919,7 @@ fn many_children() { ...@@ -931,7 +919,7 @@ fn many_children() {
inner_node.add_child_unchecked(&ctx, node.clone()); inner_node.add_child_unchecked(&ctx, node.clone());
} }
let dur = start.elapsed(); let dur = start.elapsed();
println!("Children: {:?}", dur); println!("Children: {dur:?}");
let is_slow = dur > children_duration * 2; let is_slow = dur > children_duration * 2;
if j > 10 && !is_slow { if j > 10 && !is_slow {
break; break;
...@@ -1004,7 +992,7 @@ fn fuzzy_new() { ...@@ -1004,7 +992,7 @@ fn fuzzy_new() {
for size in [10, 50, 100, 200, 1000] { for size in [10, 50, 100, 200, 1000] {
for _ in 0..100 { for _ in 0..100 {
let seed = rand::random(); let seed = rand::random();
println!("Seed {} Size {}", seed, size); println!("Seed {seed} Size {size}");
fuzzy(seed, size); fuzzy(seed, size);
} }
} }
......
...@@ -348,7 +348,7 @@ mod tests { ...@@ -348,7 +348,7 @@ mod tests {
assert!(set.is_empty()); assert!(set.is_empty());
assert_eq!( assert_eq!(
format!("{:?}", set), format!("{set:?}"),
"CountHashSet { inner: {}, negative_entries: 0 }" "CountHashSet { inner: {}, negative_entries: 0 }"
); );
} }
...@@ -392,7 +392,7 @@ mod tests { ...@@ -392,7 +392,7 @@ mod tests {
assert!(set.is_empty()); assert!(set.is_empty());
assert_eq!( assert_eq!(
format!("{:?}", set), format!("{set:?}"),
"CountHashSet { inner: {}, negative_entries: 0 }" "CountHashSet { inner: {}, negative_entries: 0 }"
); );
} }
......
...@@ -527,7 +527,7 @@ impl Backend for MemoryBackend { ...@@ -527,7 +527,7 @@ impl Backend for MemoryBackend {
match task.read_cell( match task.read_cell(
index, index,
self.gc_queue.as_ref(), self.gc_queue.as_ref(),
move || format!("reading {} {} from {}", task_id, index, reader), move || format!("reading {task_id} {index} from {reader}"),
Some(reader), Some(reader),
self, self,
turbo_tasks, turbo_tasks,
...@@ -564,7 +564,7 @@ impl Backend for MemoryBackend { ...@@ -564,7 +564,7 @@ impl Backend for MemoryBackend {
match task.read_cell( match task.read_cell(
index, index,
self.gc_queue.as_ref(), self.gc_queue.as_ref(),
move || format!("reading {} {} untracked", task_id, index), move || format!("reading {task_id} {index} untracked"),
None, None,
self, self,
turbo_tasks, turbo_tasks,
......
...@@ -616,8 +616,8 @@ impl Task { ...@@ -616,8 +616,8 @@ impl Task {
fn format_description(ty: &TaskTypeForDescription, id: TaskId) -> String { fn format_description(ty: &TaskTypeForDescription, id: TaskId) -> String {
match ty { match ty {
TaskTypeForDescription::Root => format!("[{}] root", id), TaskTypeForDescription::Root => format!("[{id}] root"),
TaskTypeForDescription::Once => format!("[{}] once", id), TaskTypeForDescription::Once => format!("[{id}] once"),
TaskTypeForDescription::Persistent(ty) => format!("[{id}] {ty}"), TaskTypeForDescription::Persistent(ty) => format!("[{id}] {ty}"),
} }
} }
...@@ -737,10 +737,7 @@ impl Task { ...@@ -737,10 +737,7 @@ impl Task {
} }
Dirty { .. } => { Dirty { .. } => {
let state_type = Task::state_string(&state); let state_type = Task::state_string(&state);
panic!( panic!("{self:?} execution started in unexpected state {state_type}")
"{:?} execution started in unexpected state {}",
self, state_type
)
} }
}; };
self.make_execution_future() self.make_execution_future()
...@@ -869,7 +866,7 @@ impl Task { ...@@ -869,7 +866,7 @@ impl Task {
} }
Ok(Err(mut err)) => { Ok(Err(mut err)) => {
if let Some(name) = self.get_function_name() { if let Some(name) = self.get_function_name() {
err = err.context(format!("Execution of {} failed", name)); err = err.context(format!("Execution of {name} failed"));
} }
state.output.error(err, turbo_tasks) state.output.error(err, turbo_tasks)
} }
......
...@@ -23,7 +23,7 @@ async fn dirty_in_progress() { ...@@ -23,7 +23,7 @@ async fn dirty_in_progress() {
(11, 13, 2, 2, ""), (11, 13, 2, 2, ""),
]; ];
for (a, b, c, value, collectible) in cases { for (a, b, c, value, collectible) in cases {
println!("{} -> {} -> {} = {} {}", a, b, c, value, collectible); println!("{a} -> {b} -> {c} = {value} {collectible}");
let input = ChangingInput { let input = ChangingInput {
state: State::new(a), state: State::new(a),
} }
...@@ -31,10 +31,10 @@ async fn dirty_in_progress() { ...@@ -31,10 +31,10 @@ async fn dirty_in_progress() {
let input_val = input.await?; let input_val = input.await?;
let output = compute(input); let output = compute(input);
output.await?; output.await?;
println!("update to {}", b); println!("update to {b}");
input_val.state.set(b); input_val.state.set(b);
tokio::time::sleep(Duration::from_millis(50)).await; tokio::time::sleep(Duration::from_millis(50)).await;
println!("update to {}", c); println!("update to {c}");
input_val.state.set(c); input_val.state.set(c);
let read = output.strongly_consistent().await?; let read = output.strongly_consistent().await?;
assert_eq!(read.value, value); assert_eq!(read.value, value);
......
...@@ -31,7 +31,7 @@ where ...@@ -31,7 +31,7 @@ where
let start = std::time::Instant::now(); let start = std::time::Instant::now();
f().await?; f().await?;
let warmup_call = start.elapsed(); let warmup_call = start.elapsed();
println!("Subsequent call took {:?}", warmup_call); println!("Subsequent call took {warmup_call:?}");
warmup_calls.push(warmup_call); warmup_calls.push(warmup_call);
} }
...@@ -99,7 +99,7 @@ where ...@@ -99,7 +99,7 @@ where
let start = std::time::Instant::now(); let start = std::time::Instant::now();
f().await?; f().await?;
let final_call = start.elapsed(); let final_call = start.elapsed();
println!("Final call took {:?}", final_call); println!("Final call took {final_call:?}");
let target = subsequent / COUNT1; let target = subsequent / COUNT1;
...@@ -114,20 +114,17 @@ where ...@@ -114,20 +114,17 @@ where
assert!( assert!(
subsequent < limit * COUNT1, subsequent < limit * COUNT1,
"Each call should be less than {:?}", "Each call should be less than {limit:?}"
limit
); );
assert!( assert!(
subsequent2 < limit * COUNT1, subsequent2 < limit * COUNT1,
"Each call should be less than {:?}", "Each call should be less than {limit:?}"
limit
); );
assert!( assert!(
subsequent3 < limit * COUNT1, subsequent3 < limit * COUNT1,
"Each call should be less than {:?}", "Each call should be less than {limit:?}"
limit
); );
anyhow::Ok(()) anyhow::Ok(())
......
...@@ -64,7 +64,7 @@ async fn func(input: Vc<ValueContainer>, nesting: i32) -> Result<Vc<Value>> { ...@@ -64,7 +64,7 @@ async fn func(input: Vc<ValueContainer>, nesting: i32) -> Result<Vc<Value>> {
return Ok(func(input, nesting + 1)); return Ok(func(input, nesting + 1));
} }
if nesting == *value { if nesting == *value {
println!("func {}", nesting); println!("func {nesting}");
return Ok(Value { value: *value }.cell()); return Ok(Value { value: *value }.cell());
} }
bail!("func no longer valid {}", nesting) bail!("func no longer valid {}", nesting)
......
...@@ -72,7 +72,7 @@ pub trait ValueDebugFormat { ...@@ -72,7 +72,7 @@ pub trait ValueDebugFormat {
impl ValueDebugFormat for String { impl ValueDebugFormat for String {
fn value_debug_format(&self, _depth: usize) -> ValueDebugFormatString { fn value_debug_format(&self, _depth: usize) -> ValueDebugFormatString {
ValueDebugFormatString::Sync(format!("{:#?}", self)) ValueDebugFormatString::Sync(format!("{self:#?}"))
} }
} }
...@@ -96,7 +96,7 @@ where ...@@ -96,7 +96,7 @@ where
return ValueDebugFormatString::Sync(std::any::type_name::<Self>().to_string()); return ValueDebugFormatString::Sync(std::any::type_name::<Self>().to_string());
} }
ValueDebugFormatString::Sync(format!("{:#?}", self)) ValueDebugFormatString::Sync(format!("{self:#?}"))
} }
} }
...@@ -153,7 +153,7 @@ where ...@@ -153,7 +153,7 @@ where
} }
} }
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
...@@ -184,7 +184,7 @@ where ...@@ -184,7 +184,7 @@ where
} }
} }
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
...@@ -215,7 +215,7 @@ where ...@@ -215,7 +215,7 @@ where
} }
} }
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
...@@ -234,7 +234,7 @@ where ...@@ -234,7 +234,7 @@ where
.iter() .iter()
.map(|(key, value)| { .map(|(key, value)| {
( (
format!("{:#?}", key), format!("{key:#?}"),
value.value_debug_format(depth.saturating_sub(1)), value.value_debug_format(depth.saturating_sub(1)),
) )
}) })
...@@ -252,7 +252,7 @@ where ...@@ -252,7 +252,7 @@ where
} }
} }
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
...@@ -271,7 +271,7 @@ where ...@@ -271,7 +271,7 @@ where
.iter() .iter()
.map(|(key, value)| { .map(|(key, value)| {
( (
format!("{:#?}", key), format!("{key:#?}"),
value.value_debug_format(depth.saturating_sub(1)), value.value_debug_format(depth.saturating_sub(1)),
) )
}) })
...@@ -289,7 +289,7 @@ where ...@@ -289,7 +289,7 @@ where
} }
} }
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
...@@ -317,7 +317,7 @@ where ...@@ -317,7 +317,7 @@ where
}; };
values_string.insert(PassthroughDebug::new_string(value)); values_string.insert(PassthroughDebug::new_string(value));
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
...@@ -358,7 +358,7 @@ where ...@@ -358,7 +358,7 @@ where
PassthroughDebug::new_string(value), PassthroughDebug::new_string(value),
); );
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
......
...@@ -302,7 +302,7 @@ impl Display for InvalidationReasonSet { ...@@ -302,7 +302,7 @@ impl Display for InvalidationReasonSet {
} }
match entry { match entry {
MapEntry::Single { reason } => { MapEntry::Single { reason } => {
write!(f, "{}", reason)?; write!(f, "{reason}")?;
} }
MapEntry::Multiple { reasons } => { MapEntry::Multiple { reasons } => {
let MapKey::Typed { kind } = key else { let MapKey::Typed { kind } = key else {
......
...@@ -21,9 +21,9 @@ pub async fn value_debug_format_field(value: ValueDebugFormatString<'_>) -> Stri ...@@ -21,9 +21,9 @@ pub async fn value_debug_format_field(value: ValueDebugFormatString<'_>) -> Stri
match value.try_to_value_debug_string().await { match value.try_to_value_debug_string().await {
Ok(result) => match result.await { Ok(result) => match result.await {
Ok(result) => result.to_string(), Ok(result) => result.to_string(),
Err(err) => format!("{0:?}", err), Err(err) => format!("{err:?}"),
}, },
Err(err) => format!("{0:?}", err), Err(err) => format!("{err:?}"),
} }
} }
......
...@@ -770,7 +770,7 @@ impl<B: Backend + 'static> TurboTasks<B> { ...@@ -770,7 +770,7 @@ impl<B: Backend + 'static> TurboTasks<B> {
let local_task_id = gts_write.create_local_task(LocalTask::Scheduled { let local_task_id = gts_write.create_local_task(LocalTask::Scheduled {
done_event: Event::new({ done_event: Event::new({
let ty = Arc::clone(&ty); let ty = Arc::clone(&ty);
move || format!("LocalTask({})::done_event", ty) move || format!("LocalTask({ty})::done_event")
}), }),
}); });
( (
...@@ -1578,10 +1578,7 @@ impl<B: Backend + 'static> TurboTasksBackendApi<B> for TurboTasks<B> { ...@@ -1578,10 +1578,7 @@ impl<B: Backend + 'static> TurboTasksBackendApi<B> for TurboTasks<B> {
pub(crate) fn current_task(from: &str) -> TaskId { pub(crate) fn current_task(from: &str) -> TaskId {
match CURRENT_TASK_STATE.try_with(|ts| ts.read().unwrap().task_id) { match CURRENT_TASK_STATE.try_with(|ts| ts.read().unwrap().task_id) {
Ok(id) => id, Ok(id) => id,
Err(_) => panic!( Err(_) => panic!("{from} can only be used in the context of turbo_tasks task execution"),
"{} can only be used in the context of turbo_tasks task execution",
from
),
} }
} }
......
...@@ -29,9 +29,9 @@ impl OutputContent { ...@@ -29,9 +29,9 @@ impl OutputContent {
impl Display for OutputContent { impl Display for OutputContent {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Self::Link(raw_vc) => write!(f, "link {:?}", raw_vc), Self::Link(raw_vc) => write!(f, "link {raw_vc:?}"),
Self::Error(err) => write!(f, "error {}", err), Self::Error(err) => write!(f, "error {err}"),
Self::Panic(Some(message)) => write!(f, "panic {}", message), Self::Panic(Some(message)) => write!(f, "panic {message}"),
Self::Panic(None) => write!(f, "panic"), Self::Panic(None) => write!(f, "panic"),
} }
} }
......
...@@ -72,7 +72,7 @@ where ...@@ -72,7 +72,7 @@ where
if let Some(id) = map_by_value.get(&value) { if let Some(id) = map_by_value.get(&value) {
id.clone() id.clone()
} else { } else {
panic!("Use of unregistered {:?}", value); panic!("Use of unregistered {value:?}");
} }
} }
......
...@@ -186,7 +186,7 @@ impl LocalTaskType { ...@@ -186,7 +186,7 @@ impl LocalTaskType {
Err(name) => { Err(name) => {
if !has_trait(value_type, trait_type) { if !has_trait(value_type, trait_type) {
let traits = traits(value_type).iter().fold(String::new(), |mut out, t| { let traits = traits(value_type).iter().fold(String::new(), |mut out, t| {
let _ = write!(out, " {}", t); let _ = write!(out, " {t}");
out out
}); });
Err(anyhow!( Err(anyhow!(
......
...@@ -104,11 +104,11 @@ impl Display for FormatDuration { ...@@ -104,11 +104,11 @@ impl Display for FormatDuration {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = self.0.as_secs(); let s = self.0.as_secs();
if s > 10 { if s > 10 {
return write!(f, "{}s", s); return write!(f, "{s}s");
} }
let ms = self.0.as_millis(); let ms = self.0.as_millis();
if ms > 10 { if ms > 10 {
return write!(f, "{}ms", ms); return write!(f, "{ms}ms");
} }
write!(f, "{}ms", (self.0.as_micros() as f32) / 1000.0) write!(f, "{}ms", (self.0.as_micros() as f32) / 1000.0)
} }
...@@ -118,14 +118,14 @@ impl Debug for FormatDuration { ...@@ -118,14 +118,14 @@ impl Debug for FormatDuration {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = self.0.as_secs(); let s = self.0.as_secs();
if s > 100 { if s > 100 {
return write!(f, "{}s", s); return write!(f, "{s}s");
} }
let ms = self.0.as_millis(); let ms = self.0.as_millis();
if ms > 10000 { if ms > 10000 {
return write!(f, "{:.2}s", (ms as f32) / 1000.0); return write!(f, "{:.2}s", (ms as f32) / 1000.0);
} }
if ms > 100 { if ms > 100 {
return write!(f, "{}ms", ms); return write!(f, "{ms}ms");
} }
write!(f, "{}ms", (self.0.as_micros() as f32) / 1000.0) write!(f, "{}ms", (self.0.as_micros() as f32) / 1000.0)
} }
...@@ -148,7 +148,7 @@ impl Display for FormatBytes { ...@@ -148,7 +148,7 @@ impl Display for FormatBytes {
if b > KB { if b > KB {
return write!(f, "{:.2}KiB", (b as f32) / 1_024.0); return write!(f, "{:.2}KiB", (b as f32) / 1_024.0);
} }
write!(f, "{}B", b) write!(f, "{b}B")
} }
} }
......
...@@ -85,7 +85,7 @@ fn bench_startup_internal( ...@@ -85,7 +85,7 @@ fn bench_startup_internal(
let input = (bundler.as_ref(), &test_app); let input = (bundler.as_ref(), &test_app);
resume_on_error(AssertUnwindSafe(|| { resume_on_error(AssertUnwindSafe(|| {
g.bench_with_input( g.bench_with_input(
BenchmarkId::new(bundler.get_name(), format!("{} modules", module_count)), BenchmarkId::new(bundler.get_name(), format!("{module_count} modules")),
&input, &input,
|b, &(bundler, test_app)| { |b, &(bundler, test_app)| {
let test_app = &**test_app; let test_app = &**test_app;
...@@ -172,7 +172,7 @@ fn bench_hmr_internal( ...@@ -172,7 +172,7 @@ fn bench_hmr_internal(
resume_on_error(AssertUnwindSafe(|| { resume_on_error(AssertUnwindSafe(|| {
g.bench_with_input( g.bench_with_input(
BenchmarkId::new(bundler.get_name(), format!("{} modules", module_count)), BenchmarkId::new(bundler.get_name(), format!("{module_count} modules")),
&input, &input,
|b, &(bundler, test_app)| { |b, &(bundler, test_app)| {
let test_app = &**test_app; let test_app = &**test_app;
...@@ -309,7 +309,7 @@ fn bench_hmr_internal( ...@@ -309,7 +309,7 @@ fn bench_hmr_internal(
FormatDuration(value / (iter as u32)), FormatDuration(value / (iter as u32)),
iter, iter,
if dropped > 0 { if dropped > 0 {
format!(" ({} dropped)", dropped) format!(" ({dropped} dropped)")
} else { } else {
"".to_string() "".to_string()
} }
...@@ -481,7 +481,7 @@ fn bench_startup_cached_internal( ...@@ -481,7 +481,7 @@ fn bench_startup_cached_internal(
resume_on_error(AssertUnwindSafe(|| { resume_on_error(AssertUnwindSafe(|| {
g.bench_with_input( g.bench_with_input(
BenchmarkId::new(bundler.get_name(), format!("{} modules", module_count)), BenchmarkId::new(bundler.get_name(), format!("{module_count} modules")),
&input, &input,
|b, &(bundler, test_app)| { |b, &(bundler, test_app)| {
let test_app = &**test_app; let test_app = &**test_app;
......
...@@ -43,7 +43,7 @@ pub fn install(install_dir: &Path, packages: &[NpmPackage<'_>]) -> Result<()> { ...@@ -43,7 +43,7 @@ pub fn install(install_dir: &Path, packages: &[NpmPackage<'_>]) -> Result<()> {
}); });
File::create(install_dir.join("package.json"))? File::create(install_dir.join("package.json"))?
.write_all(format!("{:#}", package_json).as_bytes())?; .write_all(format!("{package_json:#}").as_bytes())?;
} }
let mut args = vec![ let mut args = vec![
......
...@@ -102,7 +102,7 @@ fn format_optional_path( ...@@ -102,7 +102,7 @@ fn format_optional_path(
if let Some(context) = context { if let Some(context) = context {
let option_context = Some(context.clone()); let option_context = Some(context.clone());
if last_context == option_context { if last_context == option_context {
writeln!(formatted_issue, " at {}", description)?; writeln!(formatted_issue, " at {description}")?;
} else { } else {
writeln!( writeln!(
formatted_issue, formatted_issue,
...@@ -113,7 +113,7 @@ fn format_optional_path( ...@@ -113,7 +113,7 @@ fn format_optional_path(
last_context = option_context; last_context = option_context;
} }
} else { } else {
writeln!(formatted_issue, " at {}", description)?; writeln!(formatted_issue, " at {description}")?;
last_context = None; last_context = None;
} }
} }
...@@ -167,7 +167,7 @@ pub fn format_issue( ...@@ -167,7 +167,7 @@ pub fn format_issue(
writeln!(styled_issue, "\ndocumentation: {documentation_link}").unwrap(); writeln!(styled_issue, "\ndocumentation: {documentation_link}").unwrap();
} }
if let Some(path) = path { if let Some(path) = path {
writeln!(styled_issue, "{}", path).unwrap(); writeln!(styled_issue, "{path}").unwrap();
} }
} }
...@@ -590,7 +590,7 @@ fn style_issue_source(plain_issue: &PlainIssue, context_path: &str) -> String { ...@@ -590,7 +590,7 @@ fn style_issue_source(plain_issue: &PlainIssue, context_path: &str) -> String {
start.column, start.column,
formatted_title formatted_title
), ),
None => format!("{} {}", context_path, formatted_title), None => format!("{context_path} {formatted_title}"),
}; };
styled_issue.push('\n'); styled_issue.push('\n');
format_source_content(source, &mut styled_issue); format_source_content(source, &mut styled_issue);
......
...@@ -106,7 +106,7 @@ pub async fn app_vendors_split<'l>( ...@@ -106,7 +106,7 @@ pub async fn app_vendors_split<'l>(
} }
} }
if !chunk_group_specific_chunk_items.is_empty() { if !chunk_group_specific_chunk_items.is_empty() {
let mut name = format!("{}-specific", name); let mut name = format!("{name}-specific");
make_chunk( make_chunk(
chunk_group_specific_chunk_items, chunk_group_specific_chunk_items,
Vec::new(), Vec::new(),
...@@ -116,7 +116,7 @@ pub async fn app_vendors_split<'l>( ...@@ -116,7 +116,7 @@ pub async fn app_vendors_split<'l>(
.await?; .await?;
} }
let mut remaining = Vec::new(); let mut remaining = Vec::new();
let mut key = format!("{}-app", name); let mut key = format!("{name}-app");
if !handle_split_group( if !handle_split_group(
&mut app_chunk_items, &mut app_chunk_items,
&mut key, &mut key,
...@@ -127,7 +127,7 @@ pub async fn app_vendors_split<'l>( ...@@ -127,7 +127,7 @@ pub async fn app_vendors_split<'l>(
{ {
folder_split(app_chunk_items, 0, key.into(), split_context).await?; folder_split(app_chunk_items, 0, key.into(), split_context).await?;
} }
let mut key = format!("{}-vendors", name); let mut key = format!("{name}-vendors");
if !handle_split_group( if !handle_split_group(
&mut vendors_chunk_items, &mut vendors_chunk_items,
&mut key, &mut key,
...@@ -168,7 +168,7 @@ async fn package_name_split<'l>( ...@@ -168,7 +168,7 @@ async fn package_name_split<'l>(
} }
let mut remaining = Vec::new(); let mut remaining = Vec::new();
for (package_name, mut list) in map { for (package_name, mut list) in map {
let mut key = format!("{}-{}", name, package_name); let mut key = format!("{name}-{package_name}");
if !handle_split_group(&mut list, &mut key, split_context, Some(&mut remaining)).await? { if !handle_split_group(&mut list, &mut key, split_context, Some(&mut remaining)).await? {
folder_split(list, 0, key.into(), split_context).await?; folder_split(list, 0, key.into(), split_context).await?;
} }
...@@ -216,7 +216,7 @@ async fn folder_split<'l>( ...@@ -216,7 +216,7 @@ async fn folder_split<'l>(
map = FxIndexMap::default(); map = FxIndexMap::default();
continue; continue;
} else { } else {
let mut key = format!("{}-{}", name, folder_name); let mut key = format!("{name}-{folder_name}");
make_chunk(list, Vec::new(), &mut key, split_context).await?; make_chunk(list, Vec::new(), &mut key, split_context).await?;
return Ok(()); return Ok(());
} }
...@@ -226,7 +226,7 @@ async fn folder_split<'l>( ...@@ -226,7 +226,7 @@ async fn folder_split<'l>(
} }
let mut remaining = Vec::new(); let mut remaining = Vec::new();
for (folder_name, (new_location, mut list)) in map { for (folder_name, (new_location, mut list)) in map {
let mut key = format!("{}-{}", name, folder_name); let mut key = format!("{name}-{folder_name}");
if !handle_split_group(&mut list, &mut key, split_context, Some(&mut remaining)).await? { if !handle_split_group(&mut list, &mut key, split_context, Some(&mut remaining)).await? {
if let Some(new_location) = new_location { if let Some(new_location) = new_location {
Box::pin(folder_split( Box::pin(folder_split(
......
...@@ -58,8 +58,8 @@ pub enum ModuleId { ...@@ -58,8 +58,8 @@ pub enum ModuleId {
impl Display for ModuleId { impl Display for ModuleId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
ModuleId::Number(i) => write!(f, "{}", i), ModuleId::Number(i) => write!(f, "{i}"),
ModuleId::String(s) => write!(f, "{}", s), ModuleId::String(s) => write!(f, "{s}"),
} }
} }
} }
......
...@@ -60,11 +60,11 @@ impl ModuleIdStrategy for GlobalModuleIdStrategy { ...@@ -60,11 +60,11 @@ impl ModuleIdStrategy for GlobalModuleIdStrategy {
ModuleIssue { ModuleIssue {
ident, ident,
title: StyledString::Text( title: StyledString::Text(
format!("ModuleId not found for ident: {:?}", ident_string).into(), format!("ModuleId not found for ident: {ident_string:?}").into(),
) )
.resolved_cell(), .resolved_cell(),
description: StyledString::Text( description: StyledString::Text(
format!("ModuleId not found for ident: {:?}", ident_string).into(), format!("ModuleId not found for ident: {ident_string:?}").into(),
) )
.resolved_cell(), .resolved_cell(),
} }
......
...@@ -27,9 +27,9 @@ impl Display for PrettyPrintError<'_> { ...@@ -27,9 +27,9 @@ impl Display for PrettyPrintError<'_> {
header header
}); });
match i { match i {
0 => write!(f, "{}", header)?, 0 => write!(f, "{header}")?,
1 => write!(f, "\n\nCaused by:\n- {}", header)?, 1 => write!(f, "\n\nCaused by:\n- {header}")?,
_ => write!(f, "\n- {}", header)?, _ => write!(f, "\n- {header}")?,
} }
i += 1; i += 1;
} else { } else {
...@@ -54,10 +54,10 @@ impl Display for WithDash<'_> { ...@@ -54,10 +54,10 @@ impl Display for WithDash<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result { fn fmt(&self, f: &mut Formatter<'_>) -> Result {
let mut lines = self.0.lines(); let mut lines = self.0.lines();
if let Some(line) = lines.next() { if let Some(line) = lines.next() {
write!(f, "- {}", line)?; write!(f, "- {line}")?;
} }
for line in lines { for line in lines {
write!(f, "\n {}", line)?; write!(f, "\n {line}")?;
} }
Ok(()) Ok(())
} }
......
...@@ -76,7 +76,7 @@ impl ValueToString for AssetIdent { ...@@ -76,7 +76,7 @@ impl ValueToString for AssetIdent {
let key_str = key.await?; let key_str = key.await?;
let asset_str = asset.to_string().await?; let asset_str = asset.to_string().await?;
write!(s, " {} => {:?}", key_str, asset_str)?; write!(s, " {key_str} => {asset_str:?}")?;
} }
s.push_str(" }"); s.push_str(" }");
...@@ -101,7 +101,7 @@ impl ValueToString for AssetIdent { ...@@ -101,7 +101,7 @@ impl ValueToString for AssetIdent {
} }
if let Some(content_type) = &self.content_type { if let Some(content_type) = &self.content_type {
write!(s, " <{}>", content_type)?; write!(s, " <{content_type}>")?;
} }
if !self.parts.is_empty() { if !self.parts.is_empty() {
...@@ -109,7 +109,7 @@ impl ValueToString for AssetIdent { ...@@ -109,7 +109,7 @@ impl ValueToString for AssetIdent {
if !matches!(part, ModulePart::Facade) { if !matches!(part, ModulePart::Facade) {
// facade is not included in ident as switching between facade and non-facade // facade is not included in ident as switching between facade and non-facade
// shouldn't change the ident // shouldn't change the ident
write!(s, " <{}>", part)?; write!(s, " <{part}>")?;
} }
} }
} }
...@@ -327,7 +327,7 @@ impl AssetIdent { ...@@ -327,7 +327,7 @@ impl AssetIdent {
if has_hash { if has_hash {
let hash = encode_hex(hasher.finish()); let hash = encode_hex(hasher.finish());
let truncated_hash = &hash[..8]; let truncated_hash = &hash[..8];
write!(name, "_{}", truncated_hash)?; write!(name, "_{truncated_hash}")?;
} }
// Location in "path" where hashed and named parts are split. // Location in "path" where hashed and named parts are split.
......
...@@ -672,7 +672,7 @@ impl Display for IssueStage { ...@@ -672,7 +672,7 @@ impl Display for IssueStage {
IssueStage::Unsupported => write!(f, "unsupported"), IssueStage::Unsupported => write!(f, "unsupported"),
IssueStage::AppStructure => write!(f, "app structure"), IssueStage::AppStructure => write!(f, "app structure"),
IssueStage::Misc => write!(f, "misc"), IssueStage::Misc => write!(f, "misc"),
IssueStage::Other(s) => write!(f, "{}", s), IssueStage::Other(s) => write!(f, "{s}"),
} }
} }
} }
......
...@@ -70,7 +70,7 @@ impl Issue for ResolvingIssue { ...@@ -70,7 +70,7 @@ impl Issue for ResolvingIssue {
for request in request_parts { for request in request_parts {
match lookup_import_map(**import_map, *self.file_path, **request).await { match lookup_import_map(**import_map, *self.file_path, **request).await {
Ok(None) => {} Ok(None) => {}
Ok(Some(str)) => writeln!(description, "Import map: {}", str)?, Ok(Some(str)) => writeln!(description, "Import map: {str}")?,
Err(err) => { Err(err) => {
writeln!( writeln!(
description, description,
......
...@@ -343,7 +343,7 @@ impl SingleModuleGraph { ...@@ -343,7 +343,7 @@ impl SingleModuleGraph {
} }
} }
if !duplicates.is_empty() { if !duplicates.is_empty() {
panic!("Duplicate module idents in graph: {:#?}", duplicates); panic!("Duplicate module idents in graph: {duplicates:#?}");
} }
} }
......
...@@ -44,7 +44,7 @@ pub async fn read_package_json(path: ResolvedVc<FileSystemPath>) -> Result<Vc<Op ...@@ -44,7 +44,7 @@ pub async fn read_package_json(path: ResolvedVc<FileSystemPath>) -> Result<Vc<Op
let text = content.content().to_str()?; let text = content.content().to_str()?;
e.write_with_content(&mut message, &text)?; e.write_with_content(&mut message, &text)?;
} else { } else {
write!(message, "{}", e)?; write!(message, "{e}")?;
} }
PackageJsonIssue { PackageJsonIssue {
error_message: message.into(), error_message: message.into(),
......
...@@ -141,7 +141,7 @@ impl ImportContext { ...@@ -141,7 +141,7 @@ impl ImportContext {
if i > 0 { if i > 0 {
modifier.push(' '); modifier.push(' ');
} }
write!(modifier, "layer({})", layer)? write!(modifier, "layer({layer})")?
} }
} }
if !self.media.is_empty() { if !self.media.is_empty() {
...@@ -163,7 +163,7 @@ impl ImportContext { ...@@ -163,7 +163,7 @@ impl ImportContext {
if i > 0 { if i > 0 {
modifier.push(' '); modifier.push(' ');
} }
write!(modifier, "supports({})", supports)? write!(modifier, "supports({supports})")?
} }
} }
Ok(Vc::cell(modifier.into())) Ok(Vc::cell(modifier.into()))
......
...@@ -146,7 +146,7 @@ where ...@@ -146,7 +146,7 @@ where
value.value_debug_format(depth.saturating_sub(1)), value.value_debug_format(depth.saturating_sub(1)),
), ),
AliasKey::Wildcard { suffix } => ( AliasKey::Wildcard { suffix } => (
format!("{}*{}", key, suffix), format!("{key}*{suffix}"),
value.value_debug_format(depth.saturating_sub(1)), value.value_debug_format(depth.saturating_sub(1)),
), ),
}) })
...@@ -165,7 +165,7 @@ where ...@@ -165,7 +165,7 @@ where
} }
} }
} }
Ok(format!("{:#?}", values_string)) Ok(format!("{values_string:#?}"))
})) }))
} }
} }
...@@ -180,7 +180,7 @@ where ...@@ -180,7 +180,7 @@ where
let key = String::from_utf8(key).expect("invalid UTF-8 key in AliasMap"); let key = String::from_utf8(key).expect("invalid UTF-8 key in AliasMap");
map.iter().map(move |(alias_key, value)| match alias_key { map.iter().map(move |(alias_key, value)| match alias_key {
AliasKey::Exact => (key.clone(), value), AliasKey::Exact => (key.clone(), value),
AliasKey::Wildcard { suffix } => (format!("{}*{}", key, suffix), value), AliasKey::Wildcard { suffix } => (format!("{key}*{suffix}"), value),
}) })
})) }))
.finish() .finish()
...@@ -203,10 +203,7 @@ impl<T> AliasMap<T> { ...@@ -203,10 +203,7 @@ impl<T> AliasMap<T> {
T: Debug, T: Debug,
{ {
if matches!(request, Pattern::Alternatives(_)) { if matches!(request, Pattern::Alternatives(_)) {
panic!( panic!("AliasMap::lookup must not be called on alternatives, received {request:?}");
"AliasMap::lookup must not be called on alternatives, received {:?}",
request
);
} }
// Invariant: prefixes should be sorted by increasing length (base lengths), // Invariant: prefixes should be sorted by increasing length (base lengths),
......
...@@ -492,7 +492,7 @@ pub struct RequestKey { ...@@ -492,7 +492,7 @@ pub struct RequestKey {
impl Display for RequestKey { impl Display for RequestKey {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
if let Some(request) = &self.request { if let Some(request) = &self.request {
write!(f, "{}", request)?; write!(f, "{request}")?;
} else { } else {
write!(f, "<default>")?; write!(f, "<default>")?;
} }
...@@ -502,7 +502,7 @@ impl Display for RequestKey { ...@@ -502,7 +502,7 @@ impl Display for RequestKey {
if i > 0 { if i > 0 {
write!(f, ", ")?; write!(f, ", ")?;
} }
write!(f, "{}={}", k, v)?; write!(f, "{k}={v}")?;
} }
write!(f, ")")?; write!(f, ")")?;
} }
...@@ -538,7 +538,7 @@ impl ValueToString for ResolveResult { ...@@ -538,7 +538,7 @@ impl ValueToString for ResolveResult {
if i > 0 { if i > 0 {
result.push_str(", "); result.push_str(", ");
} }
write!(result, "{} -> ", request).unwrap(); write!(result, "{request} -> ").unwrap();
match item { match item {
ResolveResultItem::Source(a) => { ResolveResultItem::Source(a) => {
result.push_str(&a.ident().to_string().await?); result.push_str(&a.ident().to_string().await?);
...@@ -550,7 +550,7 @@ impl ValueToString for ResolveResult { ...@@ -550,7 +550,7 @@ impl ValueToString for ResolveResult {
} => { } => {
result.push_str("external "); result.push_str("external ");
result.push_str(s); result.push_str(s);
write!(result, " ({}, {})", ty, traced)?; write!(result, " ({ty}, {traced})")?;
} }
ResolveResultItem::Ignore => { ResolveResultItem::Ignore => {
result.push_str("ignore"); result.push_str("ignore");
...@@ -1029,7 +1029,7 @@ impl ResolveResult { ...@@ -1029,7 +1029,7 @@ impl ResolveResult {
request: request_key request: request_key
.request .request
.as_ref() .as_ref()
.map(|r| format!("{}{}", r, remaining).into()), .map(|r| format!("{r}{remaining}").into()),
conditions: request_key.conditions.clone(), conditions: request_key.conditions.clone(),
}, },
v.clone(), v.clone(),
...@@ -2040,7 +2040,7 @@ async fn resolve_internal_inline( ...@@ -2040,7 +2040,7 @@ async fn resolve_internal_inline(
query: _, query: _,
fragment: _, fragment: _,
} => { } => {
let uri: RcStr = format!("{}{}", protocol, remainder).into(); let uri: RcStr = format!("{protocol}{remainder}").into();
*ResolveResult::primary_with_key( *ResolveResult::primary_with_key(
RequestKey::new(uri.clone()), RequestKey::new(uri.clone()),
ResolveResultItem::External { ResolveResultItem::External {
...@@ -2054,7 +2054,7 @@ async fn resolve_internal_inline( ...@@ -2054,7 +2054,7 @@ async fn resolve_internal_inline(
if !has_alias { if !has_alias {
ResolvingIssue { ResolvingIssue {
severity: error_severity(options).await?, severity: error_severity(options).await?,
request_type: format!("unknown import: `{}`", path), request_type: format!("unknown import: `{path}`"),
request: request.to_resolved().await?, request: request.to_resolved().await?,
file_path: lookup_path.to_resolved().await?, file_path: lookup_path.to_resolved().await?,
resolve_options: options.to_resolved().await?, resolve_options: options.to_resolved().await?,
...@@ -2464,7 +2464,7 @@ async fn apply_in_package( ...@@ -2464,7 +2464,7 @@ async fn apply_in_package(
.to_resolved() .to_resolved()
.await?, .await?,
resolve_options: options.to_resolved().await?, resolve_options: options.to_resolved().await?,
error_message: Some(format!("invalid alias field value: {}", value)), error_message: Some(format!("invalid alias field value: {value}")),
source: None, source: None,
} }
.resolved_cell() .resolved_cell()
...@@ -2894,7 +2894,7 @@ async fn handle_exports_imports_field( ...@@ -2894,7 +2894,7 @@ async fn handle_exports_imports_field(
let mut conditions_state = FxHashMap::default(); let mut conditions_state = FxHashMap::default();
let query_str = query.await?; let query_str = query.await?;
let req = Pattern::Constant(format!("{}{}", path, query_str).into()); let req = Pattern::Constant(format!("{path}{query_str}").into());
let values = exports_imports_field let values = exports_imports_field
.lookup(&req) .lookup(&req)
...@@ -3215,15 +3215,15 @@ impl Display for ModulePart { ...@@ -3215,15 +3215,15 @@ impl Display for ModulePart {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self { match self {
ModulePart::Evaluation => f.write_str("module evaluation"), ModulePart::Evaluation => f.write_str("module evaluation"),
ModulePart::Export(export) => write!(f, "export {}", export), ModulePart::Export(export) => write!(f, "export {export}"),
ModulePart::RenamedExport { ModulePart::RenamedExport {
original_export, original_export,
export, export,
} => write!(f, "export {} as {}", original_export, export), } => write!(f, "export {original_export} as {export}"),
ModulePart::RenamedNamespace { export } => { ModulePart::RenamedNamespace { export } => {
write!(f, "export * as {}", export) write!(f, "export * as {export}")
} }
ModulePart::Internal(id) => write!(f, "internal part {}", id), ModulePart::Internal(id) => write!(f, "internal part {id}"),
ModulePart::Locals => f.write_str("locals"), ModulePart::Locals => f.write_str("locals"),
ModulePart::Exports => f.write_str("exports"), ModulePart::Exports => f.write_str("exports"),
ModulePart::Facade => f.write_str("facade"), ModulePart::Facade => f.write_str("facade"),
......
...@@ -82,8 +82,8 @@ fn split_off_query_fragment(raw: RcStr) -> (Pattern, Vc<RcStr>, Vc<RcStr>) { ...@@ -82,8 +82,8 @@ fn split_off_query_fragment(raw: RcStr) -> (Pattern, Vc<RcStr>, Vc<RcStr>) {
( (
Pattern::Constant(raw.into()), Pattern::Constant(raw.into()),
Vc::cell(format!("?{}", query).into()), Vc::cell(format!("?{query}").into()),
Vc::cell(format!("#{}", fragment).into()), Vc::cell(format!("#{fragment}").into()),
) )
} }
...@@ -648,7 +648,7 @@ impl Request { ...@@ -648,7 +648,7 @@ impl Request {
query, query,
fragment, fragment,
} => { } => {
let remainder = format!("{}{}", remainder, suffix).into(); let remainder = format!("{remainder}{suffix}").into();
Self::Uri { Self::Uri {
protocol: protocol.clone(), protocol: protocol.clone(),
remainder, remainder,
......
...@@ -859,7 +859,7 @@ impl Pattern { ...@@ -859,7 +859,7 @@ impl Pattern {
} }
} }
Pattern::Alternatives(_) => { Pattern::Alternatives(_) => {
panic!("for matching a Pattern must be normalized {:?}", self) panic!("for matching a Pattern must be normalized {self:?}")
} }
Pattern::Concatenation(list) => { Pattern::Concatenation(list) => {
for part in list { for part in list {
...@@ -943,7 +943,7 @@ impl Pattern { ...@@ -943,7 +943,7 @@ impl Pattern {
} }
} }
Pattern::Alternatives(_) => { Pattern::Alternatives(_) => {
panic!("for matching a Pattern must be normalized {:?}", self) panic!("for matching a Pattern must be normalized {self:?}")
} }
Pattern::Concatenation(list) => { Pattern::Concatenation(list) => {
for part in list { for part in list {
......
...@@ -412,7 +412,7 @@ impl SourceMap { ...@@ -412,7 +412,7 @@ impl SourceMap {
Ok( Ok(
if let Some(path) = *origin.parent().try_join((&*source_request).into()).await? { if let Some(path) = *origin.parent().try_join((&*source_request).into()).await? {
let path_str = path.to_string().await?; let path_str = path.to_string().await?;
let source = format!("{SOURCE_URL_PROTOCOL}///{}", path_str); let source = format!("{SOURCE_URL_PROTOCOL}///{path_str}");
let source_content = if let Some(source_content) = source_content { let source_content = if let Some(source_content) = source_content {
source_content source_content
} else if let FileContent::Content(file) = &*path.read().await? { } else if let FileContent::Content(file) = &*path.read().await? {
...@@ -430,7 +430,7 @@ impl SourceMap { ...@@ -430,7 +430,7 @@ impl SourceMap {
.replace_all(&source_request, |s: &regex::Captures<'_>| { .replace_all(&source_request, |s: &regex::Captures<'_>| {
s[0].replace('.', "_") s[0].replace('.', "_")
}); });
let source = format!("{SOURCE_URL_PROTOCOL}///{}/{}", origin_str, source); let source = format!("{SOURCE_URL_PROTOCOL}///{origin_str}/{source}");
let source_content = source_content.unwrap_or_else(|| { let source_content = source_content.unwrap_or_else(|| {
format!( format!(
"unable to access {source_request} in {origin_str} (it's leaving the \ "unable to access {source_request} in {origin_str} (it's leaving the \
......
...@@ -86,7 +86,7 @@ pub async fn resolve_source_map_sources( ...@@ -86,7 +86,7 @@ pub async fn resolve_source_map_sources(
.await? .await?
{ {
let path_str = path.to_string().await?; let path_str = path.to_string().await?;
let source = format!("{SOURCE_URL_PROTOCOL}///{}", path_str); let source = format!("{SOURCE_URL_PROTOCOL}///{path_str}");
*original_source = source; *original_source = source;
if original_content.is_none() { if original_content.is_none() {
...@@ -104,7 +104,7 @@ pub async fn resolve_source_map_sources( ...@@ -104,7 +104,7 @@ pub async fn resolve_source_map_sources(
let source = INVALID_REGEX.replace_all(original_source, |s: &regex::Captures<'_>| { let source = INVALID_REGEX.replace_all(original_source, |s: &regex::Captures<'_>| {
s[0].replace('.', "_") s[0].replace('.', "_")
}); });
*original_source = format!("{SOURCE_URL_PROTOCOL}///{}/{}", origin_str, source); *original_source = format!("{SOURCE_URL_PROTOCOL}///{origin_str}/{source}");
if original_content.is_none() { if original_content.is_none() {
*original_content = Some(format!( *original_content = Some(format!(
"unable to access {original_source} in {origin_str} (it's leaving the \ "unable to access {original_source} in {origin_str} (it's leaving the \
......
...@@ -46,7 +46,7 @@ impl CompileTarget { ...@@ -46,7 +46,7 @@ impl CompileTarget {
impl Display for CompileTarget { impl Display for CompileTarget {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self) write!(f, "{self:?}")
} }
} }
......
...@@ -521,7 +521,7 @@ impl TestAppBuilder { ...@@ -521,7 +521,7 @@ impl TestAppBuilder {
write_file( write_file(
"package.json", "package.json",
path.join("package.json"), path.join("package.json"),
format!("{:#}", package_json).as_bytes(), format!("{package_json:#}").as_bytes(),
)?; )?;
} }
......
...@@ -90,7 +90,7 @@ impl CssChunk { ...@@ -90,7 +90,7 @@ impl CssChunk {
MinifyType::NoMinify MinifyType::NoMinify
) { ) {
let id = css_item.asset_ident().to_string().await?; let id = css_item.asset_ident().to_string().await?;
writeln!(body, "/* {} */", id)?; writeln!(body, "/* {id} */")?;
} }
let close = write_import_context(&mut body, content.import_context).await?; let close = write_import_context(&mut body, content.import_context).await?;
......
...@@ -60,7 +60,7 @@ impl SingleItemCssChunk { ...@@ -60,7 +60,7 @@ impl SingleItemCssChunk {
MinifyType::NoMinify MinifyType::NoMinify
) { ) {
let id = this.item.asset_ident().to_string().await?; let id = this.item.asset_ident().to_string().await?;
writeln!(code, "/* {} */", id)?; writeln!(code, "/* {id} */")?;
} }
let content = this.item.content().await?; let content = this.item.content().await?;
let close = write_import_context(&mut code, content.import_context).await?; let close = write_import_context(&mut code, content.import_context).await?;
......
...@@ -170,7 +170,7 @@ impl CodeGenerateable for ImportAssetReference { ...@@ -170,7 +170,7 @@ impl CodeGenerateable for ImportAssetReference {
} = &*this.request.await? } = &*this.request.await?
{ {
imports.push(CssImport::External(ResolvedVc::cell( imports.push(CssImport::External(ResolvedVc::cell(
format!("{}{}", protocol, remainder).into(), format!("{protocol}{remainder}").into(),
))) )))
} }
......
...@@ -17,7 +17,7 @@ pub fn stringify_js(str: &str) -> String { ...@@ -17,7 +17,7 @@ pub fn stringify_js(str: &str) -> String {
} }
} }
format!("\"{}\"", escaped) format!("\"{escaped}\"")
} }
#[cfg(test)] #[cfg(test)]
......
...@@ -208,11 +208,10 @@ impl DevHtmlAssetContent { ...@@ -208,11 +208,10 @@ impl DevHtmlAssetContent {
for relative_path in &*self.chunk_paths { for relative_path in &*self.chunk_paths {
if relative_path.ends_with(".js") { if relative_path.ends_with(".js") {
scripts.push(format!("<script src=\"{}\"></script>", relative_path)); scripts.push(format!("<script src=\"{relative_path}\"></script>"));
} else if relative_path.ends_with(".css") { } else if relative_path.ends_with(".css") {
stylesheets.push(format!( stylesheets.push(format!(
"<link data-turbopack rel=\"stylesheet\" href=\"{}\">", "<link data-turbopack rel=\"stylesheet\" href=\"{relative_path}\">"
relative_path
)); ));
} else { } else {
anyhow::bail!("chunk with unknown asset type: {}", relative_path) anyhow::bail!("chunk with unknown asset type: {}", relative_path)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment