You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-07 17:03:01 +03:00
Fix clippy warning
This commit is contained in:
@@ -96,7 +96,7 @@ impl<'a> TryFrom<&'a str> for RawJwt<'a> {
|
|||||||
fn try_from(value: &'a str) -> Result<Self, Self::Error> {
|
fn try_from(value: &'a str) -> Result<Self, Self::Error> {
|
||||||
let mut indices = value
|
let mut indices = value
|
||||||
.char_indices()
|
.char_indices()
|
||||||
.filter_map(|(idx, c)| (c == '.').then(|| idx));
|
.filter_map(|(idx, c)| (c == '.').then_some(idx));
|
||||||
|
|
||||||
let first_dot = indices.next().ok_or(DecodeError::NoDots)?;
|
let first_dot = indices.next().ok_or(DecodeError::NoDots)?;
|
||||||
let second_dot = indices.next().ok_or(DecodeError::OnlyOneDot)?;
|
let second_dot = indices.next().ok_or(DecodeError::OnlyOneDot)?;
|
||||||
@@ -118,7 +118,7 @@ impl TryFrom<String> for RawJwt<'static> {
|
|||||||
fn try_from(value: String) -> Result<Self, Self::Error> {
|
fn try_from(value: String) -> Result<Self, Self::Error> {
|
||||||
let mut indices = value
|
let mut indices = value
|
||||||
.char_indices()
|
.char_indices()
|
||||||
.filter_map(|(idx, c)| (c == '.').then(|| idx));
|
.filter_map(|(idx, c)| (c == '.').then_some(idx));
|
||||||
|
|
||||||
let first_dot = indices.next().ok_or(DecodeError::NoDots)?;
|
let first_dot = indices.next().ok_or(DecodeError::NoDots)?;
|
||||||
let second_dot = indices.next().ok_or(DecodeError::OnlyOneDot)?;
|
let second_dot = indices.next().ok_or(DecodeError::OnlyOneDot)?;
|
||||||
|
Reference in New Issue
Block a user