diff options
| author | Zeyla Hellyer <[email protected]> | 2017-06-01 21:15:32 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-06-01 21:15:32 -0700 |
| commit | 6579b1fb0409410f303a4df5e7246c507a80f27b (patch) | |
| tree | 1f29ba75cac5f5e9527a759889d2308b893274d2 /tests | |
| parent | Fix ratelimiting::ROUTES doctest (diff) | |
| download | serenity-6579b1fb0409410f303a4df5e7246c507a80f27b.tar.xz serenity-6579b1fb0409410f303a4df5e7246c507a80f27b.zip | |
Deprecate *User::distinct, add *User::tag
`distinct`, although accurate, is an odd name for the method. Deprecate
`distinct` on `CurrentUser` and `User` and rename them to `tag`.
Additionally, optimize the creation of the resultant String by about 2x.
Instead of using the `format!` macro, create a new String with a
capacity of 37 and push the username, `'#'`, and write the discriminator
in manually.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_user.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_user.rs b/tests/test_user.rs index 790243e..494e66b 100644 --- a/tests/test_user.rs +++ b/tests/test_user.rs @@ -25,6 +25,8 @@ fn test_core() { user.avatar = None; assert!(user.avatar_url().is_none()); + + assert_eq!(user.tag(), "test#1432"); } #[test] |