Page MenuHomePhabricator

D4279.diff
No OneTemporary

D4279.diff

diff --git a/services/identity/src/config.rs b/services/identity/src/config.rs
--- a/services/identity/src/config.rs
+++ b/services/identity/src/config.rs
@@ -31,5 +31,5 @@
fn get_key_from_file<P: AsRef<Path>>(path: P) -> Result<Key, Error> {
let bytes = fs::read(path)?;
- Key::from_bytes(&bytes).map_err(|e| Error::Pake(e))
+ Key::from_bytes(&bytes).map_err(Error::Pake)
}
diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs
--- a/services/identity/src/database.rs
+++ b/services/identity/src/database.rs
@@ -134,12 +134,12 @@
let valid = parse_valid_attribute(item.remove("valid"))?;
let token = parse_token_attribute(item.remove("token"))?;
Ok(Some(AccessToken {
- user_id: user_id,
- device_id: device_id,
- token: token,
- created: created,
- auth_type: auth_type,
- valid: valid,
+ user_id,
+ device_id,
+ token,
+ created,
+ auth_type,
+ valid,
}))
}
Ok(_) => {
@@ -272,7 +272,7 @@
s: Some(created), ..
}) = attribute
{
- created.parse().map_err(|e| Error::InvalidTimestamp(e))
+ created.parse().map_err(Error::InvalidTimestamp)
} else {
Err(Error::MissingAttribute)
}
diff --git a/services/identity/src/token.rs b/services/identity/src/token.rs
--- a/services/identity/src/token.rs
+++ b/services/identity/src/token.rs
@@ -26,11 +26,11 @@
rng: &mut (impl Rng + CryptoRng),
) -> Self {
AccessToken {
- user_id: user_id,
- device_id: device_id,
+ user_id,
+ device_id,
token: Alphanumeric.sample_string(rng, 512),
created: Utc::now(),
- auth_type: auth_type,
+ auth_type,
valid: true,
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 12:24 PM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2570550
Default Alt Text
D4279.diff (1 KB)

Event Timeline