1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

storage: split the repository trait

This commit is contained in:
Quentin Gliech
2023-01-24 16:04:18 +01:00
parent 6a8c79c497
commit d14ca156ad
18 changed files with 401 additions and 308 deletions

View File

@ -15,7 +15,7 @@
use oauth2_types::scope::ScopeToken;
use rand::{
distributions::{Alphanumeric, DistString},
Rng,
RngCore,
};
use serde::Serialize;
use thiserror::Error;
@ -48,7 +48,7 @@ impl Device {
}
/// Generate a random device ID
pub fn generate<R: Rng + ?Sized>(rng: &mut R) -> Self {
pub fn generate<R: RngCore + ?Sized>(rng: &mut R) -> Self {
let id: String = Alphanumeric.sample_string(rng, DEVICE_ID_LENGTH);
Self { id }
}