You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use typed_path::NativePathBuf;fnmain(){let path1 = NativePathBuf::from("hello.txt");let path2 = path1.clone();println!("{path1:?}, {path2:?}");}
Compile error:
error[E0599]: the method `clone` exists for struct `PathBuf<WindowsEncoding>`, but its trait bounds were not satisfied
--> src\main.rs:5:23
|
5 | let path2 = path1.clone();
| ^^^^^ method cannot be called on `PathBuf<WindowsEncoding>` due to unsatisfied trait bounds
|
::: C:\Users\jay\.cargo\registry\src\github.com-1ecc6299db9ec823\typed-path-0.2.1\src\common\non_utf8\pathbuf.rs:61:1
|
61 | pub struct PathBuf<T>
| --------------------- doesn't satisfy `typed_path::PathBuf<WindowsEncoding>: Clone`
|
::: C:\Users\jay\.cargo\registry\src\github.com-1ecc6299db9ec823\typed-path-0.2.1\src\windows\non_utf8.rs:19:1
|
19 | pub struct WindowsEncoding;
| -------------------------- doesn't satisfy `WindowsEncoding: Clone`
|
= note: the following trait bounds were not satisfied:
`WindowsEncoding: Clone`
which is required by `typed_path::PathBuf<WindowsEncoding>: Clone`
The text was updated successfully, but these errors were encountered:
@parasyte can you try this with the new 0.3 release? I updated the code to be more relaxed in the clone and debug requirements, so this should make it where you can leverage clone like normal.
WindowsPathBuf
andUnixPathBuf
type aliases do not implementClone
due to missing trait bound requirements.UnixEncoding
andWindowsEncoding
must implementClone
to satisfy theT: Clone
bound in:Minimal test case:
Compile error:
The text was updated successfully, but these errors were encountered: