it's probably okay to make it just a Str
, since this is the domain of irc and it doesn't have players, it has nicknames and usernames and other stuff (which probably could be wrapped into newtypes in future)
also according to the rust code style variables are named in snake_case and not in camelCase
unwrap
crashes the app here, also not needed since the constructor doesn't fail and can return just raw value without Result
core
is not really a good module to put prefix-related types, since they are irc-specific.
it was deliberately made non-pub, because I want to limit the creation of PlayerId
s to the smart constructor PlayerId::from
, which validates the format and returns the values if all is fine
this is not the way, you should actually iterate over members in a for-loop and call writer.write_all
there