Skip to content

Add IPath #58

Open
Open
@kirillsemyonkin

Description

@kirillsemyonkin

The Path type and similar also need the IString treatment when used in an environment that wants more immutability. Basically, copy the string module, add some Path-specific utilities, and then have a better experience with them.

In particular, the methods like canonicalize and read_dir should be mirrored to return IPath as opposed to be defaulted to via Deref to Path and PathBuf. This will let users stay in the immutable world a bit longer. Also a new method should be put in place (just like in &Path) to allow easy conversion from &str and such.

Some methods operate on OsString/OsStr. It might be preferable to cover them as well, but I am not sure if IOsString is desired. Maybe methods like file_name_lossy and into_iter_lossy should be added instead, that would give users IString instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions