stefans-utils 0.10.1

A collection of useful Rust utility functions, types, and traits.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::{Path, PathBuf};

use crate::as_str::AsStr;

impl AsStr for PathBuf {
    fn as_str(&self) -> &str {
        self.as_os_str().to_str().unwrap_or_default()
    }
}

impl AsStr for Path {
    fn as_str(&self) -> &str {
        self.as_os_str().to_str().unwrap_or_default()
    }
}