diff --git a/src/local_util.rs b/src/local_util.rs index bb9922f..c876422 100644 --- a/src/local_util.rs +++ b/src/local_util.rs @@ -5,7 +5,8 @@ use std::{ }; use rust_util::{ XResult, new_box_error, }; -pub fn read_file_content(file: &Path, large_file_len: u64) -> XResult { +pub fn read_file_content>(p: P, large_file_len: u64) -> XResult { + let file = p.as_ref(); if !file.exists() { return Err(new_box_error(&format!("File not exists: {:?}", file))); }