mirror of
https://github.com/jht5945/finding.git
synced 2025-12-27 13:20:03 +08:00
&Path -> AsRef<Path>
This commit is contained in:
@@ -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<String> {
|
||||
pub fn read_file_content<P: AsRef<Path>>(p: P, large_file_len: u64) -> XResult<String> {
|
||||
let file = p.as_ref();
|
||||
if !file.exists() {
|
||||
return Err(new_box_error(&format!("File not exists: {:?}", file)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user