Skip to content

Commit

Permalink
Merge pull request #44 from claby2/fix-path-warnings
Browse files Browse the repository at this point in the history
fix: take path rather than pathbuf as argument
  • Loading branch information
virchau13 authored Mar 28, 2021
2 parents 3bf7ff8 + bb042e2 commit 897e5cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bin/ambit/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::os::windows::fs::symlink_file as symlink;
use std::{
fs,
io::{self, Write},
path::PathBuf,
path::{Path, PathBuf},
process::Command,
};

Expand Down Expand Up @@ -46,7 +46,7 @@ fn get_config_entries(config_path: &AmbitPath) -> AmbitResult<Vec<Entry>> {
}

// Return if link_name is symlinked to target (link_name -> target).
fn is_symlinked(link_name: &PathBuf, target: &PathBuf) -> bool {
fn is_symlinked(link_name: &Path, target: &Path) -> bool {
fs::read_link(link_name)
.map(|link_path| link_path == *target)
.unwrap_or(false)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl AmbitTester {
}

// Write content to a given path.
fn with_file_with_content(self, path: &PathBuf, content: &str) -> Self {
fn with_file_with_content(self, path: &Path, content: &str) -> Self {
fs::create_dir_all(path.parent().unwrap()).unwrap();
File::create(&path).unwrap();
fs::write(&path, content).unwrap();
Expand Down

0 comments on commit 897e5cf

Please sign in to comment.