You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Move to Rust edition 2021
Also bump MSRV to 1.56 and use the same clippy lints in every crate
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
name = "mas-data-model"
|
||||
version = "0.1.0"
|
||||
authors = ["Quentin Gliech <quenting@element.io>"]
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
|
@ -12,6 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![deny(clippy::all)]
|
||||
#![deny(rustdoc::broken_intra_doc_links)]
|
||||
#![warn(clippy::pedantic)]
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
#![allow(clippy::missing_panics_doc)]
|
||||
#![allow(clippy::missing_errors_doc)]
|
||||
#![allow(clippy::trait_duplication_in_bounds)]
|
||||
|
||||
pub mod errors;
|
||||
pub(crate) mod oauth2;
|
||||
pub(crate) mod tokens;
|
||||
|
@ -30,6 +30,7 @@ pub struct Pkce {
|
||||
}
|
||||
|
||||
impl Pkce {
|
||||
#[must_use]
|
||||
pub fn new(challenge_method: CodeChallengeMethod, challenge: String) -> Self {
|
||||
Pkce {
|
||||
challenge_method,
|
||||
@ -37,6 +38,7 @@ impl Pkce {
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn verify(&self, verifier: &str) -> bool {
|
||||
self.challenge_method.verify(&self.challenge, verifier)
|
||||
}
|
||||
@ -77,6 +79,7 @@ impl<T: StorageBackend> Default for AuthorizationGrantStage<T> {
|
||||
}
|
||||
|
||||
impl<T: StorageBackend> AuthorizationGrantStage<T> {
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
Self::Pending
|
||||
}
|
||||
@ -119,7 +122,7 @@ impl<T: StorageBackend> AuthorizationGrantStage<T> {
|
||||
|
||||
impl<S: StorageBackendMarker> From<AuthorizationGrantStage<S>> for AuthorizationGrantStage<()> {
|
||||
fn from(s: AuthorizationGrantStage<S>) -> Self {
|
||||
use AuthorizationGrantStage::*;
|
||||
use AuthorizationGrantStage::{Cancelled, Exchanged, Fulfilled, Pending};
|
||||
match s {
|
||||
Pending => Pending,
|
||||
Fulfilled {
|
||||
|
@ -30,6 +30,7 @@ impl<T: StorageBackend> User<T>
|
||||
where
|
||||
T::UserData: Default,
|
||||
{
|
||||
#[must_use]
|
||||
pub fn samples() -> Vec<Self> {
|
||||
vec![User {
|
||||
data: Default::default(),
|
||||
@ -92,6 +93,7 @@ where
|
||||
T::BrowserSessionData: Default,
|
||||
T::UserData: Default,
|
||||
{
|
||||
#[must_use]
|
||||
pub fn samples() -> Vec<Self> {
|
||||
User::<T>::samples()
|
||||
.into_iter()
|
||||
|
Reference in New Issue
Block a user