gnieto
824cefb3e9
Properly validate localpart when parsing UserId
...
When a `UserId` was created via `parse_with_server_name` (and its
variants), the localpart was not validated. This lead to invalid user
ids being constructed and lead to a crash when `is_historical` was
called.
This changes will prevent that this invalid user is can be constructed.
2022-01-03 14:58:38 +00:00
Jonas Platte
bba7d62442
identifiers: Add Rc
/ Arc
parsing constructors
2021-11-26 21:03:11 +01:00
Jonas Platte
6324034f03
identifiers: Generate public parse
functions for opaque ID types with invariants
2021-11-26 20:57:47 +01:00
Jonas Platte
4132c43cbb
identifiers: Remove runtime checks for server_name extraction
2021-11-26 17:43:02 +01:00
Jonas Platte
87051c3cb6
identifiers: Make server_name! macro return a reference instead of an owned value
...
It is easy to turn it into an owned value through `.to_owned()`.
The reverse was not possible without tying the reference to the lifetime
of a temporary variable.
2021-11-26 00:53:07 +01:00
Jonas Platte
f448f6756e
identifiers: Derive PartialEq, Eq, PartialOrd, Ord, Hash for str newtypes
...
… instead of generating them in our own macro.
2021-11-26 00:40:44 +01:00
Jonas Platte
3ce578f384
identifiers: Make UserId a DST
2021-11-26 00:40:40 +01:00
Jonas Platte
1a87403ba2
Rewrite some Display & Debug implementations
...
To delete in a more obvious way and to include debug formatting for
Debug impls (i.e. enclose the string in quotes).
2021-11-18 19:49:40 +01:00
Jonas Platte
271491732e
Remove now-redundant doc(cfg) attributes
...
They are now implied:
https://github.com/rust-lang/rust/pull/89596
2021-10-08 11:52:18 +02:00
Jonas Platte
7cbffe35da
identifiers: Add matrix.to URL formatting
2021-09-23 21:12:57 +02:00
Jonas Platte
8b44f279c8
Use server_name! macro in tests
2021-09-23 20:33:45 +02:00
Jonas Platte
e147308277
identifiers: Improve readability of server_name methods
2021-09-23 18:54:03 +02:00
Jonas Platte
a2254562b9
identifiers: Rewrap doc comment
2021-09-22 13:40:34 +02:00
Jonas Platte
ef0e9c77c3
identifiers: Merge impl blocks
2021-09-22 13:40:01 +02:00
Jonas Platte
25dd8e8e2a
identifiers: Fix a typo in function name
2021-06-01 12:49:01 +02:00
Devin Ragotzy
c6aa2e0428
Fix clippy warnings across workspace
2021-05-06 06:16:28 -04:00
Jonas Platte
3db0ea7026
Move all crates into a new crates directory
2021-05-03 15:50:27 +02:00