Skip to content

Commit 715251e

Browse files
committed
chore: cleanup Rust use declarations
This now sorts use declarations in blocks, which is a widely used style. The first block is for std, core, and alloc. The second one is for external crates. The third one is for crate internal use declarations.
1 parent e1ff6b9 commit 715251e

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎crates/web-bot-auth/src/keyring.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
use std::collections::HashMap;
2+
13
use base64::{Engine as _, engine::general_purpose};
24
use ed25519_dalek::{VerifyingKey, ed25519};
35
use serde::{Deserialize, Serialize};
46
use sha2::{Digest, Sha256};
5-
use std::collections::HashMap;
67

78
/// Errors that may be thrown by this module
89
/// when importing a JWK key.

‎crates/web-bot-auth/src/lib.rs‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ pub mod keyring;
2525
/// Implementation of HTTP Message Signatures
2626
pub mod message_signatures;
2727

28-
use components::CoveredComponent;
29-
use message_signatures::{MessageVerifier, ParsedLabel, SignatureTiming, SignedMessage};
30-
3128
use data_url::DataUrl;
32-
use keyring::{Algorithm, JSONWebKeySet, KeyRing};
3329

34-
use crate::components::{HTTPField, HTTPFieldParameters};
30+
use components::{CoveredComponent, HTTPField, HTTPFieldParameters};
31+
use keyring::{Algorithm, JSONWebKeySet, KeyRing};
32+
use message_signatures::{MessageVerifier, ParsedLabel, SignatureTiming, SignedMessage};
3533

3634
/// Errors that may be thrown by this module.
3735
#[derive(Debug)]
@@ -309,11 +307,10 @@ impl WebBotAuthVerifier {
309307

310308
#[cfg(test)]
311309
mod tests {
312-
313-
use components::DerivedComponent;
314310
use indexmap::IndexMap;
315311

316312
use super::*;
313+
use components::DerivedComponent;
317314

318315
struct StandardTestVector {}
319316

‎crates/web-bot-auth/src/message_signatures.rs‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
use super::ImplementationError;
2-
use crate::components::{self, CoveredComponent, HTTPField};
3-
use crate::keyring::{Algorithm, KeyRing};
1+
use std::fmt::Write as _;
2+
use std::sync::LazyLock;
3+
44
use indexmap::IndexMap;
55
use regex::bytes::Regex;
66
use sfv::SerializeValue;
7-
use std::fmt::Write as _;
8-
use std::sync::LazyLock;
97
use time::{Duration, UtcDateTime};
8+
9+
use super::ImplementationError;
10+
use crate::components::{self, CoveredComponent, HTTPField};
11+
use crate::keyring::{Algorithm, KeyRing};
12+
1013
static OBSOLETE_LINE_FOLDING: LazyLock<Regex> =
1114
LazyLock::new(|| Regex::new(r"\s*\r\n\s+").unwrap());
1215

@@ -601,11 +604,10 @@ impl MessageVerifier {
601604

602605
#[cfg(test)]
603606
mod tests {
604-
605-
use crate::components::{DerivedComponent, HTTPField, HTTPFieldParametersSet};
606607
use indexmap::IndexMap;
607608

608609
use super::*;
610+
use crate::components::{DerivedComponent, HTTPField, HTTPFieldParametersSet};
609611

610612
struct StandardTestVector {}
611613

0 commit comments

Comments
 (0)