From e124196611623b0d46cd74167d1ba8d9202c82e3 Mon Sep 17 00:00:00 2001 From: Naiker Date: Sun, 26 Jan 2025 17:22:38 +0000 Subject: [PATCH] style: improve code formatting and readability --- src/auth/jwt.rs | 13 ++++++++----- src/cli.rs | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/auth/jwt.rs b/src/auth/jwt.rs index 03ee996d1..59536d420 100644 --- a/src/auth/jwt.rs +++ b/src/auth/jwt.rs @@ -179,11 +179,14 @@ mod tests { expected_claim.extend(claims); let expected_value = Value::from(expected_claim); - // We check between `Value` instead of `String` to avoid key ordering issues when serializing. - // It is because `expected_value` has all the keys in alphabetical order, as the `Value` serialization ensures that. - // But when serializing `input_user_claims`, first the `pid` and `exp` fields are serialized (in that order), - // and then the claims are serialized in alfabetic order. So, the resulting JSON string from the `input_user_claims` serialization - // may have the `pid` and `exp` fields unordered which differs from the `Value` serialization. + // We check between `Value` instead of `String` to avoid key ordering issues + // when serializing. It is because `expected_value` has all the keys in + // alphabetical order, as the `Value` serialization ensures that. + // But when serializing `input_user_claims`, first the `pid` and `exp` fields + // are serialized (in that order), and then the claims are serialized in + // alfabetic order. So, the resulting JSON string from the `input_user_claims` + // serialization may have the `pid` and `exp` fields unordered which + // differs from the `Value` serialization. assert_eq!( expected_value, serde_json::to_value(&input_user_claims).unwrap() diff --git a/src/cli.rs b/src/cli.rs index 87bf2a8c1..571344abc 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -448,7 +448,8 @@ impl ComponentArg { fallback_file: fallback_file.clone(), host: config.server.host.clone(), port: config.server.port, - background_queue: config.workers.mode == WorkerMode::BackgroundQueue, + background_queue: config.workers.mode + == crate::config::WorkerMode::BackgroundQueue, postgres, sqlite, })