create IntoPathBuf

This commit is contained in:
grimhilt
2023-08-25 16:25:29 +02:00
parent d323ae3070
commit aced8b992a
6 changed files with 33 additions and 6 deletions

18
src/utils/into.rs Normal file
View 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)
}
}