Repository: vercel/next.js
File: crates/next-api/src/pages.rs (Rust)

Code before:
        let this = &*self.await?;
        let original_name = &this.original_name;
        let span = {
            match &this.ty {
                PageEndpointType::Html => {
                    tracing::info_span!("page endpoint HTML", name = display(original_name))
                }
                PageEndpointType::Data => {
                    tracing::info_span!("page endpoint data", name = display(original_name))
                }
                PageEndpointType::Api => {
                    tracing::info_span!("page endpoint API", name = display(original_name))
                }
                PageEndpointType::SsrOnly => {
                    tracing::info_span!("page endpoint SSR", name = display(original_name))
                }
            }
        };
        async move {
            let output = self.output();
            let project = this.pages_project.project();
            let node_root = project.node_root().owned().await?;
            let client_relative_root = project.client_relative_path().owned().await?;

            let output_assets = self.output().output_assets();

            let (server_paths, client_paths) = if project.next_mode().await?.is_development() {
                let server_paths = all_asset_paths(output_assets, node_root.clone(), None)
                    .owned()
                    .await?;

                let client_paths = all_paths_in_root(output_assets, client_relative_root)
                    .owned()
                    .await?;
                (server_paths, client_paths)
            } else {
                (vec![], vec![])
            };

            let written_endpoint = match *output.await? {
                PageEndpointOutput::NodeJs { entry_chunk, .. } => {
                    // Only set server_entry_path if pages should be created
                    let pages_structure = this.pages_structure.await?;
                    let server_entry_path = if pages_structure.should_create_pages_entries {
                        node_root
                            .get_path_to(&*entry_chunk.path().await?)
                            .context("ssr chunk entry path must be inside the node root")?
                            .into()
                    } else {
                        rcstr!("") // Empty path when no pages should be created
                    };

Review comment (suggestion):
```suggestion
            let output = self.output();
            let project = this.pages_project.project();
            let node_root = project.node_root().owned().await?;
            let client_relative_root = project.client_relative_path().owned().await?;

            let output_assets = output.output_assets();

```

Code after:
        let this = &*self.await?;
        let original_name = &this.original_name;
        let span = {
            match &this.ty {
                PageEndpointType::Html => {
                    tracing::info_span!("page endpoint HTML", name = display(original_name))
                }
                PageEndpointType::Data => {
                    tracing::info_span!("page endpoint data", name = display(original_name))
                }
                PageEndpointType::Api => {
                    tracing::info_span!("page endpoint API", name = display(original_name))
                }
                PageEndpointType::SsrOnly => {
                    tracing::info_span!("page endpoint SSR", name = display(original_name))
                }
            }
        };
        async move {
            let output = self.output();
            let project = this.pages_project.project();
            let node_root = project.node_root().owned().await?;
            let client_relative_root = project.client_relative_path().owned().await?;

            let output_assets = output.output_assets();

            let (server_paths, client_paths) = if project.next_mode().await?.is_development() {
                let server_paths = all_asset_paths(output_assets, node_root.clone(), None)
                    .owned()
                    .await?;
                let client_paths = all_paths_in_root(output_assets, client_relative_root)
                    .owned()
                    .await?;
                (server_paths, client_paths)
            } else {
                (vec![], vec![])
            };

            let written_endpoint = match *output.await? {
                PageEndpointOutput::NodeJs { entry_chunk, .. } => {
                    // Only set server_entry_path if pages should be created
                    let pages_structure = this.pages_structure.await?;
                    let server_entry_path = if pages_structure.should_create_pages_entries {
                        node_root
                            .get_path_to(&*entry_chunk.path().await?)
                            .context("ssr chunk entry path must be inside the node root")?
                            .into()
                    } else {
                        rcstr!("") // Empty path when no pages should be created
                    };