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
What I wanted to do was archived_example.name == thing.x, but that doesn't compile:
error[E0277]: can't compare `ArchivedString` with `Cow<'_, str>`
--> foo.rs:94:34
|
94 | if archived_example.name == thing.x
| ^^ no implementation for `ArchivedString == Cow<'_, str>`
|
= help: the trait `PartialEq<Cow<'_, str>>` is not implemented for `ArchivedString`
= help: the following other types implement trait `PartialEq<Rhs>`:
<ArchivedString as PartialEq>
<ArchivedString as PartialEq<std::string::String>>
<ArchivedString as PartialEq<str>>
<ArchivedString as PartialEq<&str>>
I have
and
fn lookup(&self, thing: &Thing) ...
What I wanted to do was
archived_example.name == thing.x
, but that doesn't compile:Could ArchivedString also handle Cow, please?
Workaround:
archived_example.name.as_str() == thing.x
The text was updated successfully, but these errors were encountered: