Skip to content

How to check reference equality between lua strings? #694

@dubrowgn

Description

@dubrowgn

impl PartialEq for ValueRef calls ffi::lua_rawequal, which does a reference equality check. Most mlua ValueRef wrapper types derive PartialEq, and thus use reference equality. However, the mlua String type implements its own PartialEq using member-wise comparison of u8 slices.

I don't see a way to get ValueRef out of String (it's pub(crate)), so how can I do reference equality with Lua strings from rust?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions