Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl From/Into Lua for char #516

Merged
merged 5 commits into from
Jan 28, 2025
Merged

impl From/Into Lua for char #516

merged 5 commits into from
Jan 28, 2025

Conversation

tkr-sh
Copy link
Contributor

@tkr-sh tkr-sh commented Jan 21, 2025

FromLua:

  • integer: check if u8, if yes convert to char else error
  • string: only if one char the only char, else error
  • else: error

IntoLua:
convert to a ::mlua::String of length 1


Why ?
I think its important to have support for char since it's in std


Note

char in rust is more a u32 than a u8 actually. So Im ok that this is modified from u8 to u32 if needed.

@khvzak khvzak merged commit 47bc372 into mlua-rs:main Jan 28, 2025
@khvzak
Copy link
Member

khvzak commented Jan 28, 2025

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants