Fix a few warnings
This commit is contained in:
parent
0d96cbefe1
commit
424517fab0
@ -1,7 +1,6 @@
|
|||||||
use chrono;
|
use chrono;
|
||||||
use diesel::PgConnection;
|
use diesel::PgConnection;
|
||||||
use serde_json;
|
use serde_json;
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use activity_pub::actor::Actor;
|
use activity_pub::actor::Actor;
|
||||||
use activity_pub::object::Object;
|
use activity_pub::object::Object;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
use base64;
|
use base64;
|
||||||
use diesel::PgConnection;
|
use diesel::PgConnection;
|
||||||
use hex;
|
|
||||||
use openssl::hash::{Hasher, MessageDigest};
|
use openssl::hash::{Hasher, MessageDigest};
|
||||||
use openssl::sha::sha256;
|
|
||||||
use reqwest::header::{Date, Headers, UserAgent};
|
use reqwest::header::{Date, Headers, UserAgent};
|
||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
|
|
||||||
@ -45,7 +43,7 @@ pub fn signature<S: Signer>(signer: &S, headers: Headers, conn: &PgConnection) -
|
|||||||
|
|
||||||
pub fn digest(body: String) -> Digest {
|
pub fn digest(body: String) -> Digest {
|
||||||
let mut hasher = Hasher::new(MessageDigest::sha256()).unwrap();
|
let mut hasher = Hasher::new(MessageDigest::sha256()).unwrap();
|
||||||
hasher.update(&body.into_bytes()[..]);
|
hasher.update(&body.into_bytes()[..]).unwrap();
|
||||||
let res = base64::encode(&hasher.finish().unwrap());
|
let res = base64::encode(&hasher.finish().unwrap());
|
||||||
Digest(format!("SHA-256={}", res))
|
Digest(format!("SHA-256={}", res))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user