Skip to content

Commit

Permalink
Merge pull request #970 from charlespierce/clippy_warnings
Browse files Browse the repository at this point in the history
Clean up clippy warnings from new Rust version
  • Loading branch information
charlespierce committed Apr 14, 2021
2 parents cb03e50 + e690d60 commit 662671b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/volta-core/src/tool/npm/fetch.rs
@@ -1,7 +1,7 @@
//! Provides fetcher for npm distributions

use std::fs::{write, File};
use std::path::{Path, PathBuf};
use std::path::Path;

use super::super::download_tool_error;
use super::super::registry::public_registry_package;
Expand Down Expand Up @@ -108,7 +108,7 @@ fn unpack_archive(archive: Box<dyn Archive>, version: &Version) -> Fallible<()>
/// Return the archive if it is valid. It may have been corrupted or interrupted in the middle of
/// downloading.
/// ISSUE(#134) - verify checksum
fn load_cached_distro(file: &PathBuf) -> Option<Box<dyn Archive>> {
fn load_cached_distro(file: &Path) -> Option<Box<dyn Archive>> {
if file.is_file() {
let file = File::open(file).ok()?;
Tarball::load(file).ok()
Expand Down
4 changes: 2 additions & 2 deletions crates/volta-core/src/tool/yarn/fetch.rs
@@ -1,7 +1,7 @@
//! Provides fetcher for Yarn distributions

use std::fs::File;
use std::path::{Path, PathBuf};
use std::path::Path;

use super::super::download_tool_error;
use super::super::registry::{find_unpack_dir, public_registry_package};
Expand Down Expand Up @@ -101,7 +101,7 @@ fn unpack_archive(archive: Box<dyn Archive>, version: &Version) -> Fallible<()>
/// Return the archive if it is valid. It may have been corrupted or interrupted in the middle of
/// downloading.
// ISSUE(#134) - verify checksum
fn load_cached_distro(file: &PathBuf) -> Option<Box<dyn Archive>> {
fn load_cached_distro(file: &Path) -> Option<Box<dyn Archive>> {
if file.is_file() {
let file = File::open(file).ok()?;
Tarball::load(file).ok()
Expand Down
4 changes: 1 addition & 3 deletions src/command/setup.rs
Expand Up @@ -84,10 +84,8 @@ mod os {
fn determine_profiles() -> Fallible<Vec<PathBuf>> {
let home_dir = dirs::home_dir().ok_or(ErrorKind::NoHomeEnvironmentVar)?;
let shell = env::var("SHELL").unwrap_or_else(|_| String::new());
let mut profiles = Vec::new();

// Always include `~/.profile`
profiles.push(home_dir.join(".profile"));
let mut profiles = vec![home_dir.join(".profile")];

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

0 comments on commit 662671b

Please sign in to comment.