Skip to content

Commit a5956d7

Browse files
Merge pull request #1374 from charlespierce/clippy_warnings
Fix clippy warnings and rust-toolchain.toml file
2 parents 31504a3 + ddd6192 commit a5956d7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

crates/volta-core/src/platform/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fn test_image_path() {
112112
let node_npm_pnpm = Image {
113113
node: Sourced::with_default(v123.clone()),
114114
npm: Some(Sourced::with_default(v643.clone())),
115-
pnpm: Some(Sourced::with_default(v771.clone())),
115+
pnpm: Some(Sourced::with_default(v771)),
116116
yarn: None,
117117
};
118118

crates/volta-core/src/tool/package/manager.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ impl PackageManager {
103103

104104
if let PackageManager::Yarn = self {
105105
command.env("npm_config_global_folder", self.source_root(package_root));
106-
} else
107-
// FIXME: Find out if there is a perfect way to intercept pnpm global
108-
// installs by using environment variables or whatever.
109-
// Using `--global-dir` and `--global-bin-dir` flags here is not enough,
110-
// because pnpm generates _absolute path_ based symlinks, and this makes
111-
// impossible to simply move installed packages from the staging directory
112-
// to the final `image/packages/` destination.
113-
if let PackageManager::Pnpm = self {
106+
} else if let PackageManager::Pnpm = self {
107+
// FIXME: Find out if there is a perfect way to intercept pnpm global
108+
// installs by using environment variables or whatever.
109+
// Using `--global-dir` and `--global-bin-dir` flags here is not enough,
110+
// because pnpm generates _absolute path_ based symlinks, and this makes
111+
// impossible to simply move installed packages from the staging directory
112+
// to the final `image/packages/` destination.
113+
114114
// Specify the staging directory to store global package,
115115
// see: https://pnpm.io/npmrc#global-dir
116116
command.arg("--global-dir").arg(&package_root);
@@ -125,8 +125,7 @@ impl PackageManager {
125125
// pass the check.
126126
// See: https://github.com/volta-cli/rfcs/pull/46#discussion_r861943740
127127
let mut new_path = global_bin_dir;
128-
let mut command_envs = command.get_envs();
129-
while let Some((name, value)) = command_envs.next() {
128+
for (name, value) in command.get_envs() {
130129
if name == "PATH" {
131130
if let Some(old_path) = value {
132131
#[cfg(unix)]

rust-toolchain.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[toolchain]
22
channel = "1.63"
3+
components = ["clippy", "rustfmt"]
34
profile = "minimal"

0 commit comments

Comments
 (0)