From 424517fab05bd512807ceccb3a7e7d1196b38248 Mon Sep 17 00:00:00 2001 From: Bat Date: Wed, 9 May 2018 21:35:50 +0100 Subject: [PATCH] Fix a few warnings --- src/activity_pub/activity.rs | 1 - src/activity_pub/request.rs | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/activity_pub/activity.rs b/src/activity_pub/activity.rs index a068ad0..7edfa37 100644 --- a/src/activity_pub/activity.rs +++ b/src/activity_pub/activity.rs @@ -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; diff --git a/src/activity_pub/request.rs b/src/activity_pub/request.rs index dc00f75..0db67b7 100644 --- a/src/activity_pub/request.rs +++ b/src/activity_pub/request.rs @@ -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(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)) }