Fix the clippy ptr_arg lint

This commit is contained in:
Andreas Rammhold 2021-05-16 18:06:10 +02:00 committed by Cole Helbling
parent 36fc9ab70d
commit a91c6c5b12
No known key found for this signature in database
GPG key ID: B37E0F2371016A4C

View file

@ -5,7 +5,7 @@ use crate::writetoline::LineWriter;
use std::fs::{self, File, OpenOptions};
use std::io::Write;
use std::path::{Component, PathBuf};
use std::path::{Component, Path, PathBuf};
use lru_cache::LruCache;
use tracing::warn;
@ -34,7 +34,7 @@ pub struct LogMessage {
message: MsgType,
}
fn validate_path_segment(segment: &PathBuf) -> Result<(), String> {
fn validate_path_segment(segment: &Path) -> Result<(), String> {
let components = segment.components();
if components.count() == 0 {
@ -148,7 +148,7 @@ impl LogMessageCollector {
}
}
fn open_file(&self, path: &PathBuf) -> Result<File, String> {
fn open_file(&self, path: &Path) -> Result<File, String> {
let dir = path.parent().unwrap();
fs::create_dir_all(dir).unwrap();