Minor cleanup.

Suggested by clippy.
This commit is contained in:
Rasmus Kaj 2021-04-02 02:13:38 +02:00
parent 85c7a32978
commit f5bc9d7e98
3 changed files with 8 additions and 6 deletions

View File

@ -43,8 +43,10 @@ fn gzipped(data: &[u8]) -> Result<Vec<u8>, Error> {
fn brcompressed(data: &[u8]) -> Result<Vec<u8>, Error> {
let mut buf = Vec::new();
let mut params = BrotliEncoderParams::default();
params.quality = 11;
let params = BrotliEncoderParams {
quality: 11,
..Default::default()
};
BrotliCompress(&mut data.as_ref(), &mut buf, &params)?;
Ok(buf)
}

View File

@ -99,7 +99,7 @@ impl GlobalContext {
.ok_or_else(|| "User missing in jwt claims".to_string())
}
fn cache(&self) -> Result<PooledMemcache, Error> {
Ok(self.memcache_pool.get()?)
self.memcache_pool.get()
}
}

View File

@ -36,9 +36,9 @@ impl UrlString {
}
}
impl Into<String> for UrlString {
fn into(self) -> String {
self.value
impl From<UrlString> for String {
fn from(url: UrlString) -> String {
url.value
}
}