Fix a few warnings

This commit is contained in:
Bat 2018-05-09 21:35:50 +01:00
parent 0d96cbefe1
commit 424517fab0
2 changed files with 1 additions and 4 deletions

View File

@ -1,7 +1,6 @@
use chrono;
use diesel::PgConnection;
use serde_json;
use std::str::FromStr;
use activity_pub::actor::Actor;
use activity_pub::object::Object;

View File

@ -1,8 +1,6 @@
use base64;
use diesel::PgConnection;
use hex;
use openssl::hash::{Hasher, MessageDigest};
use openssl::sha::sha256;
use reqwest::header::{Date, Headers, UserAgent};
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 {
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());
Digest(format!("SHA-256={}", res))
}