diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-06-10 11:09:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-10 11:09:45 -0400 |
commit | 7f15126f23d97f20a4fb33e43136cd4d13825863 (patch) | |
tree | 85d77389969b31999680059e65954a9fa863758e /test_util/src/npm.rs | |
parent | f3326eebd6af2aaca1543e8cb543a7b16762bc96 (diff) |
chore(tests): test_util - Add `PathRef` (#19450)
This adds a new `PathRef` struct to test_util for making it easier to
work with paths in test code. I'm going to expand on this more in the
future.
Diffstat (limited to 'test_util/src/npm.rs')
-rw-r--r-- | test_util/src/npm.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test_util/src/npm.rs b/test_util/src/npm.rs index 18949ad44..98308ae21 100644 --- a/test_util/src/npm.rs +++ b/test_util/src/npm.rs @@ -93,10 +93,7 @@ fn get_npm_package(package_name: &str) -> Result<Option<CustomNpmPackage>> { builder .append_dir_all("package", &version_folder) .with_context(|| { - format!( - "Error adding tarball for directory: {}", - version_folder.display() - ) + format!("Error adding tarball for directory: {}", version_folder) })?; builder.finish()?; } @@ -128,10 +125,7 @@ fn get_npm_package(package_name: &str) -> Result<Option<CustomNpmPackage>> { let package_json_path = version_folder.join("package.json"); let package_json_text = fs::read_to_string(&package_json_path) .with_context(|| { - format!( - "Error reading package.json at {}", - package_json_path.display() - ) + format!("Error reading package.json at {}", package_json_path) })?; let mut version_info: serde_json::Map<String, serde_json::Value> = serde_json::from_str(&package_json_text)?; |