Skip to content

Commit 662671b

Browse files
Merge pull request #970 from charlespierce/clippy_warnings
Clean up clippy warnings from new Rust version
2 parents cb03e50 + e690d60 commit 662671b

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

crates/volta-core/src/tool/npm/fetch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Provides fetcher for npm distributions
22
33
use std::fs::{write, File};
4-
use std::path::{Path, PathBuf};
4+
use std::path::Path;
55

66
use super::super::download_tool_error;
77
use super::super::registry::public_registry_package;
@@ -108,7 +108,7 @@ fn unpack_archive(archive: Box<dyn Archive>, version: &Version) -> Fallible<()>
108108
/// Return the archive if it is valid. It may have been corrupted or interrupted in the middle of
109109
/// downloading.
110110
/// ISSUE(#134) - verify checksum
111-
fn load_cached_distro(file: &PathBuf) -> Option<Box<dyn Archive>> {
111+
fn load_cached_distro(file: &Path) -> Option<Box<dyn Archive>> {
112112
if file.is_file() {
113113
let file = File::open(file).ok()?;
114114
Tarball::load(file).ok()

crates/volta-core/src/tool/yarn/fetch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Provides fetcher for Yarn distributions
22
33
use std::fs::File;
4-
use std::path::{Path, PathBuf};
4+
use std::path::Path;
55

66
use super::super::download_tool_error;
77
use super::super::registry::{find_unpack_dir, public_registry_package};
@@ -101,7 +101,7 @@ fn unpack_archive(archive: Box<dyn Archive>, version: &Version) -> Fallible<()>
101101
/// Return the archive if it is valid. It may have been corrupted or interrupted in the middle of
102102
/// downloading.
103103
// ISSUE(#134) - verify checksum
104-
fn load_cached_distro(file: &PathBuf) -> Option<Box<dyn Archive>> {
104+
fn load_cached_distro(file: &Path) -> Option<Box<dyn Archive>> {
105105
if file.is_file() {
106106
let file = File::open(file).ok()?;
107107
Tarball::load(file).ok()

src/command/setup.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ mod os {
8484
fn determine_profiles() -> Fallible<Vec<PathBuf>> {
8585
let home_dir = dirs::home_dir().ok_or(ErrorKind::NoHomeEnvironmentVar)?;
8686
let shell = env::var("SHELL").unwrap_or_else(|_| String::new());
87-
let mut profiles = Vec::new();
88-
8987
// Always include `~/.profile`
90-
profiles.push(home_dir.join(".profile"));
88+
let mut profiles = vec![home_dir.join(".profile")];
9189

9290
// PROFILE environment variable, if set
9391
if let Ok(profile_env) = env::var("PROFILE") {

0 commit comments

Comments
 (0)