Skip to content

Commit 0fe703b

Browse files
committed
Replace assert!(matches!( with assert_matches!(
1 parent 7d7cb26 commit 0fe703b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/graphql/auth.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ impl<'r> AdminRequest<'r> {
7474

7575
#[derive(Debug)]
7676
struct InvalidVisit;
77+
78+
#[cfg_attr(test, derive(Debug))]
7779
struct Visit {
7880
proposal: u32,
7981
session: u16,
@@ -179,6 +181,7 @@ impl From<reqwest::Error> for AuthError {
179181
mod tests {
180182
use std::str::FromStr as _;
181183

184+
use assert_matches::assert_matches;
182185
use axum::http::HeaderValue;
183186
use axum_extra::headers::authorization::{Bearer, Credentials};
184187
use axum_extra::headers::Authorization;
@@ -211,7 +214,7 @@ mod tests {
211214
#[case::invalid_proposal("cm123abc-12")]
212215
#[case::negative_session("cm1234--12")]
213216
fn invalid_visit(#[case] visit: &str) {
214-
assert!(matches!(Visit::from_str(visit), Err(InvalidVisit)))
217+
assert_matches!(Visit::from_str(visit), Err(InvalidVisit))
215218
}
216219

217220
#[tokio::test]

0 commit comments

Comments
 (0)