Skip to content

Add PartialEq impl to allow equality checking WString and WStr #7

@mr-adult

Description

@mr-adult

Could we please add an implementation of PartialEq<WString> on WStr and vice versa to make these operations easier?

For example, take this code snippet:

let WString = WString::<BE>::from("My string");
let WStr = &WString[..];
WStr == WString;

I see this error on the last line:

can't compare `&WStr<BigEndian>` with `WString<BigEndian>`
the trait `PartialEq<WString<BigEndian>>` is not implemented for `&WStr<BigEndian>`rustc[Click for full compiler diagnostic](rust-analyzer-diagnostics-view:/diagnostic message [2]?2#file:///c%3A/Users/ad4mb/Documents/rust-projects/mumps/mumps_lsp/src/utf16string_extensions.rs)
utf16string_extensions.rs(154, 3): consider dereferencing both sides of the expression: `*`, `*`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions