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

Add a dedicated RoomName type #159

Closed
jplatte opened this issue Jul 25, 2020 · 5 comments · Fixed by #645
Closed

Add a dedicated RoomName type #159

jplatte opened this issue Jul 25, 2020 · 5 comments · Fixed by #645

Comments

@jplatte
Copy link
Member

jplatte commented Jul 25, 2020

… to ruma_events::room::name. It should encapsulate the "max 255 characters" rule, implement TryFrom<String> and Into<String>.

@timokoesters
Copy link
Member

The PublicRoomsChunk struct in ruma-common/src/directory.rs also needs to be changed

@timokoesters
Copy link
Member

And RoomName should allow .to_string() or .as_str()

@jplatte
Copy link
Member Author

jplatte commented Jul 15, 2021

Yes, definitely should wrap String / str / Box<str> and provide an as_str() / impl AsRef<str>; to_string() too via impl Display.

@Frinksy
Copy link
Contributor

Frinksy commented Jul 18, 2021

Since ruma-common does not depend on ruma-events, would it make sense to move the new RoomName type to ruma-identifiers?

@jplatte
Copy link
Member Author

jplatte commented Jul 19, 2021

Yes, sounds good 👍

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

Successfully merging a pull request may close this issue.

3 participants