stefans_utils/path/
as_str.rs1use std::path::{Path, PathBuf};
2
3use crate::as_str::AsStr;
4
5impl AsStr for PathBuf {
6 fn as_str(&self) -> &str {
7 self.as_os_str().to_str().unwrap_or_default()
8 }
9}
10
11impl AsStr for Path {
12 fn as_str(&self) -> &str {
13 self.as_os_str().to_str().unwrap_or_default()
14 }
15}