beef icon indicating copy to clipboard operation
beef copied to clipboard

Support for `Path`/`PathBuf`

Open Alxandr opened this issue 6 years ago • 3 comments

As far as I can see, I'm not able to put own/std types into a beefcow except those that are explicitly enabled in this library. So would it be possible to add support for Path/PathBuf?

Alxandr avatar Apr 26 '20 20:04 Alxandr

Sadly neither PathBuf or OsString exposes *_raw_parts methods, or any way to get a byte pointer or some such, so this has to sit on the backburner until std is extended.

maciejhirsz avatar May 02 '20 08:05 maciejhirsz

Yeah. I looked at implementing it myself the other day and ran into the same issue. Was hoping that more eyes on the issue might figure out something clever :P. Maybe if there exists some other type than PathBuf that is AsRef<Path> that does allow getting parts?

Alxandr avatar May 02 '20 16:05 Alxandr

The only such type that can correctly map it is OsStr/OsSTring. The os_str_bytes crate might be of some use here, will have to dig in further.

maciejhirsz avatar May 02 '20 19:05 maciejhirsz