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 compact_str::CompactStr;fnmain(){dbg!(CompactStr::from("hello") == "hello");}
Example that don't work:
use compact_str::CompactStr;fnmain(){dbg!("hello" == CompactStr::from("hello"));}
Error:
error[E0277]: can't compare `&str` with `CompactStr`
--> src/main.rs:4:18
|
4 | dbg!("hello" == CompactStr::from("hello"));
| ^^ no implementation for `&str == CompactStr`
|
= help: the trait `PartialEq<CompactStr>` is not implemented for `&str`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `test01` due to previous error
I think it shouldn't make any differences whether you want to compare &str with CompactStr, &str with &CompactStr, CompactStr with &str or &CompactStr with &str.
The text was updated successfully, but these errors were encountered:
Thanks for submitting the issue! I figured there would be a couple missing impls like this, I'll try and get this fixed soon. If someone else would like to submit a PR though, feel free 🙂
Example that works:
Example that don't work:
Error:
I think it shouldn't make any differences whether you want to compare
&str
withCompactStr
,&str
with&CompactStr
,CompactStr
with&str
or&CompactStr
with&str
.The text was updated successfully, but these errors were encountered: