From 69d96e1e66372d7280c1631881136cf4a207002a Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 23 Jan 2026 19:48:37 +0000 Subject: [PATCH] build.rs: inline fn canonicalize --- build.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/build.rs b/build.rs index 536ce42ee..09feefc25 100644 --- a/build.rs +++ b/build.rs @@ -5,10 +5,6 @@ use rsconf::Target; use std::path::{Path, PathBuf}; -fn canonicalize>(path: P) -> PathBuf { - std::fs::canonicalize(path).unwrap() -} - fn main() { setup_paths(); @@ -19,14 +15,14 @@ fn main() { "FISH_RESOLVED_BUILD_DIR", // If set by CMake, this might include symlinks. Since we want to compare this to the // dir fish is executed in we need to canonicalize it. - canonicalize(fish_build_dir()).to_str().unwrap(), + fish_build_dir().canonicalize().unwrap().to_str().unwrap(), ); // We need to canonicalize (i.e. realpath) the manifest dir because we want to be able to // compare it directly as a string at runtime. rsconf::set_env_value( "CARGO_MANIFEST_DIR", - canonicalize(workspace_root()).to_str().unwrap(), + workspace_root().canonicalize().unwrap().to_str().unwrap(), ); // Some build info