Commit d2ffa892 authored by Luke Sandberg's avatar Luke Sandberg

Fix a few unnecessary formatting operations

parent b4ff6d93
...@@ -23,6 +23,8 @@ exclude = [ ...@@ -23,6 +23,8 @@ exclude = [
[workspace.lints.clippy] [workspace.lints.clippy]
too_many_arguments = "allow" too_many_arguments = "allow"
to_string_in_format_args = "warn"
unnecessary_to_owned = "warn"
[workspace.lints.rust] [workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [ unexpected_cfgs = { level = "warn", check-cfg = [
......
...@@ -1585,16 +1585,16 @@ impl Endpoint for PageEndpoint { ...@@ -1585,16 +1585,16 @@ impl Endpoint for PageEndpoint {
let span = { let span = {
match &this.ty { match &this.ty {
PageEndpointType::Html => { PageEndpointType::Html => {
tracing::info_span!("page endpoint HTML", name = original_name.to_string()) tracing::info_span!("page endpoint HTML", name = %original_name)
} }
PageEndpointType::Data => { PageEndpointType::Data => {
tracing::info_span!("page endpoint data", name = original_name.to_string()) tracing::info_span!("page endpoint data", name = %original_name)
} }
PageEndpointType::Api => { PageEndpointType::Api => {
tracing::info_span!("page endpoint API", name = original_name.to_string()) tracing::info_span!("page endpoint API", name = %original_name)
} }
PageEndpointType::SsrOnly => { PageEndpointType::SsrOnly => {
tracing::info_span!("page endpoint SSR", name = original_name.to_string()) tracing::info_span!("page endpoint SSR", name = %original_name)
} }
} }
}; };
......
...@@ -328,10 +328,10 @@ async fn get_pages_structure_for_directory( ...@@ -328,10 +328,10 @@ async fn get_pages_structure_for_directory(
position: u32, position: u32,
page_extensions: Vc<Vec<RcStr>>, page_extensions: Vc<Vec<RcStr>>,
) -> Result<Vc<PagesDirectoryStructure>> { ) -> Result<Vc<PagesDirectoryStructure>> {
let span = { let span = tracing::info_span!(
let path = project_path.value_to_string().await?.to_string(); "analyze pages structure",
tracing::info_span!("analyze pages structure", name = path) name = display(project_path.value_to_string().await?)
}; );
async move { async move {
let page_extensions_raw = &*page_extensions.await?; let page_extensions_raw = &*page_extensions.await?;
......
...@@ -570,7 +570,7 @@ impl ChunkingContext for BrowserChunkingContext { ...@@ -570,7 +570,7 @@ impl ChunkingContext for BrowserChunkingContext {
module_graph: Vc<ModuleGraph>, module_graph: Vc<ModuleGraph>,
availability_info: AvailabilityInfo, availability_info: AvailabilityInfo,
) -> Result<Vc<ChunkGroupResult>> { ) -> Result<Vc<ChunkGroupResult>> {
let span = tracing::info_span!("chunking", name = ident.to_string().await?.to_string()); let span = tracing::info_span!("chunking", name = display(ident.to_string().await?));
async move { async move {
let this = self.await?; let this = self.await?;
let entries = chunk_group.entries(); let entries = chunk_group.entries();
...@@ -637,10 +637,11 @@ impl ChunkingContext for BrowserChunkingContext { ...@@ -637,10 +637,11 @@ impl ChunkingContext for BrowserChunkingContext {
module_graph: Vc<ModuleGraph>, module_graph: Vc<ModuleGraph>,
input_availability_info: AvailabilityInfo, input_availability_info: AvailabilityInfo,
) -> Result<Vc<ChunkGroupResult>> { ) -> Result<Vc<ChunkGroupResult>> {
let span = { let span = tracing::info_span!(
let ident = ident.to_string().await?.to_string(); "chunking",
tracing::info_span!("chunking", chunking_type = "evaluated", ident = ident) ident = display(ident.to_string().await?.to_string()),
}; chunking_type = "evaluated",
);
async move { async move {
let this = self.await?; let this = self.await?;
let entries = chunk_group.entries(); let entries = chunk_group.entries();
......
...@@ -1522,26 +1522,13 @@ pub async fn resolve( ...@@ -1522,26 +1522,13 @@ pub async fn resolve(
request: Vc<Request>, request: Vc<Request>,
options: Vc<ResolveOptions>, options: Vc<ResolveOptions>,
) -> Result<Vc<ResolveResult>> { ) -> Result<Vc<ResolveResult>> {
resolve_inline(lookup_path, reference_type, request, options).await let span = tracing::info_span!(
} "resolving",
name = display(request.to_string().await?),
pub async fn resolve_inline( lookup_path = display(&lookup_path.path),
lookup_path: FileSystemPath, reference_type = display(&reference_type),
reference_type: ReferenceType, );
request: Vc<Request>, async move {
options: Vc<ResolveOptions>,
) -> Result<Vc<ResolveResult>> {
let span = {
let lookup_path = lookup_path.value_to_string().await?.to_string();
let request = request.to_string().await?.to_string();
tracing::info_span!(
"resolving",
lookup_path = lookup_path,
name = request,
reference_type = display(&reference_type),
)
};
async {
let before_plugins_result = handle_before_resolve_plugins( let before_plugins_result = handle_before_resolve_plugins(
lookup_path.clone(), lookup_path.clone(),
reference_type.clone(), reference_type.clone(),
...@@ -1740,15 +1727,11 @@ async fn resolve_internal_inline( ...@@ -1740,15 +1727,11 @@ async fn resolve_internal_inline(
request: Vc<Request>, request: Vc<Request>,
options: Vc<ResolveOptions>, options: Vc<ResolveOptions>,
) -> Result<Vc<ResolveResult>> { ) -> Result<Vc<ResolveResult>> {
let span = { let span = tracing::info_span!(
let lookup_path = lookup_path.value_to_string().await?.to_string(); "internal resolving",
let request = request.to_string().await?.to_string(); name = display(request.to_string().await?),
tracing::info_span!( lookup_path = display(&lookup_path.path),
"internal resolving", );
lookup_path = lookup_path,
name = request
)
};
async move { async move {
let options_value: &ResolveOptions = &*options.await?; let options_value: &ResolveOptions = &*options.await?;
......
...@@ -363,10 +363,10 @@ pub async fn parse_css( ...@@ -363,10 +363,10 @@ pub async fn parse_css(
ty: CssModuleAssetType, ty: CssModuleAssetType,
environment: Option<ResolvedVc<Environment>>, environment: Option<ResolvedVc<Environment>>,
) -> Result<Vc<ParseCssResult>> { ) -> Result<Vc<ParseCssResult>> {
let span = { let span = tracing::info_span!(
let name = source.ident().to_string().await?.to_string(); "parse css",
tracing::info_span!("parse css", name = name) name = display(source.ident().to_string().await?)
}; );
async move { async move {
let content = source.content(); let content = source.content();
let ident_str = &*source.ident().to_string().await?; let ident_str = &*source.ident().to_string().await?;
......
...@@ -174,8 +174,11 @@ pub async fn parse( ...@@ -174,8 +174,11 @@ pub async fn parse(
ty: EcmascriptModuleAssetType, ty: EcmascriptModuleAssetType,
transforms: ResolvedVc<EcmascriptInputTransforms>, transforms: ResolvedVc<EcmascriptInputTransforms>,
) -> Result<Vc<ParseResult>> { ) -> Result<Vc<ParseResult>> {
let name = source.ident().to_string().await?.to_string(); let span = tracing::info_span!(
let span = tracing::info_span!("parse ecmascript", name = name, ty = display(&ty)); "parse ecmascript",
name = display(source.ident().to_string().await?),
ty = display(&ty)
);
match parse_internal(source, ty, transforms) match parse_internal(source, ty, transforms)
.instrument(span) .instrument(span)
......
...@@ -484,10 +484,10 @@ pub(crate) async fn analyze_ecmascript_module( ...@@ -484,10 +484,10 @@ pub(crate) async fn analyze_ecmascript_module(
module: ResolvedVc<EcmascriptModuleAsset>, module: ResolvedVc<EcmascriptModuleAsset>,
part: Option<ModulePart>, part: Option<ModulePart>,
) -> Result<Vc<AnalyzeEcmascriptModuleResult>> { ) -> Result<Vc<AnalyzeEcmascriptModuleResult>> {
let span = { let span = tracing::info_span!(
let module = module.ident().to_string().await?.to_string(); "analyze ecmascript module",
tracing::info_span!("analyze ecmascript module", name = module) name = display(module.ident().to_string().await?)
}; );
let result = analyze_ecmascript_module_internal(module, part) let result = analyze_ecmascript_module_internal(module, part)
.instrument(span) .instrument(span)
.await; .await;
......
...@@ -383,7 +383,7 @@ impl ChunkingContext for NodeJsChunkingContext { ...@@ -383,7 +383,7 @@ impl ChunkingContext for NodeJsChunkingContext {
module_graph: Vc<ModuleGraph>, module_graph: Vc<ModuleGraph>,
availability_info: AvailabilityInfo, availability_info: AvailabilityInfo,
) -> Result<Vc<ChunkGroupResult>> { ) -> Result<Vc<ChunkGroupResult>> {
let span = tracing::info_span!("chunking", name = ident.to_string().await?.to_string()); let span = tracing::info_span!("chunking", name = display(ident.to_string().await?));
async move { async move {
let modules = chunk_group.entries(); let modules = chunk_group.entries();
let MakeChunkGroupResult { let MakeChunkGroupResult {
......
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