Skip to content

Add .to_std() #64

Description

@RustyNova016

This crate is pretty great! ... Until you need to pass the path to File::open()...
Could we have a conversion function that convert any path back into an std PathBuf?

For my use case I did a quick hack that is good enough, but I'm not versed in all the filesystem pitfalls that can happen, so an actual proper function would be nice

use core::str::FromStr;
use std::path::PathBuf;

use typed_path::WindowsPath;

#[extend::ext]
pub impl WindowsPath {
    fn to_std(&self) -> PathBuf {
        PathBuf::from_str(self.to_str().unwrap()).unwrap()
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions