lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README | LICENSE

commit d7551caab503e98f33f9d69e3761c7ff38913eab
parent 4e6c7eb1853a16b05ea47e372e767d2a43e23389
Author: triesap <tyson@radroots.org>
Date:   Sun, 15 Feb 2026 17:51:03 +0000

identity: apply cargo fmt

Diffstat:
Midentity/src/identity.rs | 12++++++++++--
Midentity/src/lib.rs | 8++++----
Midentity/src/username.rs | 3+--
3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/identity/src/identity.rs b/identity/src/identity.rs @@ -73,7 +73,11 @@ impl RadrootsIdentity { } pub fn with_profile(keys: Keys, profile: RadrootsIdentityProfile) -> Self { - let profile = if profile.is_empty() { None } else { Some(profile) }; + let profile = if profile.is_empty() { + None + } else { + Some(profile) + }; Self { keys, profile } } @@ -138,7 +142,11 @@ impl RadrootsIdentity { } pub fn set_profile(&mut self, profile: RadrootsIdentityProfile) { - self.profile = if profile.is_empty() { None } else { Some(profile) }; + self.profile = if profile.is_empty() { + None + } else { + Some(profile) + }; } pub fn clear_profile(&mut self) { diff --git a/identity/src/lib.rs b/identity/src/lib.rs @@ -10,10 +10,10 @@ pub mod username; pub use error::IdentityError; pub use identity::{ - RadrootsIdentity, RadrootsIdentityFile, RadrootsIdentityProfile, - RadrootsIdentitySecretKeyFormat, DEFAULT_IDENTITY_PATH, + DEFAULT_IDENTITY_PATH, RadrootsIdentity, RadrootsIdentityFile, RadrootsIdentityProfile, + RadrootsIdentitySecretKeyFormat, }; pub use username::{ - radroots_username_is_valid, radroots_username_normalize, RADROOTS_USERNAME_MAX_LEN, - RADROOTS_USERNAME_MIN_LEN, RADROOTS_USERNAME_REGEX, + RADROOTS_USERNAME_MAX_LEN, RADROOTS_USERNAME_MIN_LEN, RADROOTS_USERNAME_REGEX, + radroots_username_is_valid, radroots_username_normalize, }; diff --git a/identity/src/username.rs b/identity/src/username.rs @@ -5,8 +5,7 @@ use alloc::string::String; pub const RADROOTS_USERNAME_MIN_LEN: usize = 3; pub const RADROOTS_USERNAME_MAX_LEN: usize = 30; -pub const RADROOTS_USERNAME_REGEX: &str = - r"^(?!.*\.\.)(?!\.)(?!.*\.$)[a-z0-9._-]{3,30}$"; +pub const RADROOTS_USERNAME_REGEX: &str = r"^(?!.*\.\.)(?!\.)(?!.*\.$)[a-z0-9._-]{3,30}$"; pub fn radroots_username_is_valid(username: &str) -> bool { if !username.is_ascii() {