create IntoPathBuf
This commit is contained in:
18
src/utils/into.rs
Normal file
18
src/utils/into.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub trait IntoPathBuf {
|
||||
fn into(self) -> PathBuf;
|
||||
}
|
||||
|
||||
impl IntoPathBuf for PathBuf {
|
||||
fn into(self) -> PathBuf {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoPathBuf for String {
|
||||
fn into(self) -> PathBuf {
|
||||
PathBuf::from(self)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user