Skip to content

Commit 45d367e

Browse files
committed
Derive Eq, Hash for String new types
1 parent 0348987 commit 45d367e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ new_type![///
471471
/// Client identifier issued to the client during the registration process described by
472472
/// [Section 2.2](https://tools.ietf.org/html/rfc6749#section-2.2).
473473
///
474-
#[derive(Deserialize, Serialize)]
474+
#[derive(Deserialize, Serialize, Eq, Hash)]
475475
ClientId(String)];
476476

477477
new_type![#[derive(Deserialize, Serialize)]
@@ -511,18 +511,19 @@ new_type![///
511511
/// Authorization endpoint response (grant) type defined in
512512
/// [Section 3.1.1](https://tools.ietf.org/html/rfc6749#section-3.1.1).
513513
///
514-
#[derive(Deserialize, Serialize)]
514+
#[derive(Deserialize, Serialize, Eq, Hash)]
515515
ResponseType(String)];
516516
new_type![///
517517
/// Resource owner's username used directly as an authorization grant to obtain an access
518518
/// token.
519519
///
520+
#[derive(Deserialize, Serialize, Eq, Hash)]
520521
ResourceOwnerUsername(String)];
521522

522523
new_type![///
523524
/// Access token scope, as defined by the authorization server.
524525
///
525-
#[derive(Deserialize, Serialize)]
526+
#[derive(Deserialize, Serialize, Eq, Hash)]
526527
Scope(String)];
527528
impl AsRef<str> for Scope {
528529
fn as_ref(&self) -> &str {
@@ -539,7 +540,7 @@ new_type![///
539540
/// Code Challenge Method used for [PKCE]((https://tools.ietf.org/html/rfc7636)) protection
540541
/// via the `code_challenge_method` parameter.
541542
///
542-
#[derive(Deserialize, Serialize)]
543+
#[derive(Deserialize, Serialize, Eq, Hash)]
543544
PkceCodeChallengeMethod(String)];
544545

545546
new_secret_type![///

0 commit comments

Comments
 (0)