From 012c8d2026bae696da4cb078143ac62d18c50d19 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Fri, 15 Jan 2021 22:35:19 +0900 Subject: [PATCH] Remove redundant imports --- plume-common/src/activity_pub/mod.rs | 1 - plume-common/src/activity_pub/request.rs | 1 - plume-common/src/activity_pub/sign.rs | 3 --- plume-common/src/lib.rs | 3 --- plume-models/src/blogs.rs | 1 - plume-models/src/comments.rs | 1 - plume-models/src/inbox.rs | 1 - plume-models/src/medias.rs | 1 - plume-models/src/posts.rs | 1 - plume-models/src/users.rs | 2 -- src/api/mod.rs | 1 - src/main.rs | 1 - src/routes/instance.rs | 1 - src/routes/user.rs | 1 - src/routes/well_known.rs | 1 - 15 files changed, 20 deletions(-) mode change 100644 => 100755 plume-common/src/lib.rs mode change 100644 => 100755 src/api/mod.rs diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index b30937d4..bf83530b 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -7,7 +7,6 @@ use rocket::{ response::{Responder, Response}, Outcome, }; -use serde_json; use tokio::prelude::*; use tracing::{debug, warn}; diff --git a/plume-common/src/activity_pub/request.rs b/plume-common/src/activity_pub/request.rs index 795c7d11..29201180 100644 --- a/plume-common/src/activity_pub/request.rs +++ b/plume-common/src/activity_pub/request.rs @@ -1,4 +1,3 @@ -use base64; use chrono::{offset::Utc, DateTime}; use openssl::hash::{Hasher, MessageDigest}; use reqwest::header::{HeaderMap, HeaderValue, ACCEPT, CONTENT_TYPE, DATE, USER_AGENT}; diff --git a/plume-common/src/activity_pub/sign.rs b/plume-common/src/activity_pub/sign.rs index 745bb83f..496d4c6d 100644 --- a/plume-common/src/activity_pub/sign.rs +++ b/plume-common/src/activity_pub/sign.rs @@ -1,10 +1,7 @@ use super::request; -use base64; use chrono::{naive::NaiveDateTime, DateTime, Duration, Utc}; -use hex; use openssl::{pkey::PKey, rsa::Rsa, sha::sha256}; use rocket::http::HeaderMap; -use serde_json; /// Returns (public key, private key) pub fn gen_keypair() -> (Vec, Vec) { diff --git a/plume-common/src/lib.rs b/plume-common/src/lib.rs old mode 100644 new mode 100755 index 085f1a42..878923d4 --- a/plume-common/src/lib.rs +++ b/plume-common/src/lib.rs @@ -2,9 +2,6 @@ #[macro_use] extern crate activitystreams_derive; -use activitystreams_traits; - -use serde; #[macro_use] extern crate shrinkwraprs; #[macro_use] diff --git a/plume-models/src/blogs.rs b/plume-models/src/blogs.rs index ab7a5d28..0bea73d4 100644 --- a/plume-models/src/blogs.rs +++ b/plume-models/src/blogs.rs @@ -20,7 +20,6 @@ use plume_common::activity_pub::{ inbox::{AsActor, FromId}, sign, ActivityStream, ApSignature, Id, IntoId, PublicKey, Source, }; -use serde_json; use url::Url; use webfinger::*; diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index c4ac79bb..d2bcb9b8 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -24,7 +24,6 @@ use plume_common::{ }, utils, }; -use serde_json; use std::collections::HashSet; #[derive(Queryable, Identifiable, Clone, AsChangeset)] diff --git a/plume-models/src/inbox.rs b/plume-models/src/inbox.rs index 71c8587c..72acba2a 100644 --- a/plume-models/src/inbox.rs +++ b/plume-models/src/inbox.rs @@ -1,5 +1,4 @@ use activitypub::activity::*; -use serde_json; use crate::{ comments::Comment, diff --git a/plume-models/src/medias.rs b/plume-models/src/medias.rs index 1994dd03..e8d989f6 100644 --- a/plume-models/src/medias.rs +++ b/plume-models/src/medias.rs @@ -10,7 +10,6 @@ use plume_common::{ activity_pub::{inbox::FromId, Id}, utils::MediaProcessor, }; -use reqwest; use std::{fs, path::Path}; #[derive(Clone, Identifiable, Queryable)] diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index 0917237c..e10c2fc1 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -19,7 +19,6 @@ use plume_common::{ }, utils::md_to_html, }; -use serde_json; use std::collections::HashSet; pub type LicensedArticle = CustomObject; diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 9a3395e9..753774f8 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -11,7 +11,6 @@ use activitypub::{ object::{Image, Tombstone}, Activity, CustomObject, Endpoint, }; -use bcrypt; use chrono::{NaiveDateTime, Utc}; use diesel::{self, BelongingToDsl, ExpressionMethods, OptionalExtension, QueryDsl, RunQueryDsl}; use ldap3::{LdapConn, Scope, SearchEntry}; @@ -38,7 +37,6 @@ use rocket::{ outcome::IntoOutcome, request::{self, FromRequest, Request}, }; -use serde_json; use std::{ cmp::PartialEq, hash::{Hash, Hasher}, diff --git a/src/api/mod.rs b/src/api/mod.rs old mode 100644 new mode 100755 index bcac7509..439b394d --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -4,7 +4,6 @@ use rocket::{ response::{self, Responder}, }; use rocket_contrib::json::Json; -use serde_json; use plume_common::utils::random_hex; use plume_models::{api_tokens::*, apps::App, users::User, Error, PlumeRocket}; diff --git a/src/main.rs b/src/main.rs index 08282fc2..cc7561cd 100755 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,6 @@ use std::process::exit; use std::sync::{Arc, Mutex}; use std::time::Duration; use tracing::warn; -use tracing_subscriber; init_i18n!( "plume", af, ar, bg, ca, cs, cy, da, de, el, en, eo, es, fa, fi, fr, gl, he, hi, hr, hu, it, diff --git a/src/routes/instance.rs b/src/routes/instance.rs index 861996e6..407c5fb1 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -5,7 +5,6 @@ use rocket::{ use rocket_contrib::json::Json; use rocket_i18n::I18n; use scheduled_thread_pool::ScheduledThreadPool; -use serde_json; use std::str::FromStr; use validator::{Validate, ValidationErrors}; diff --git a/src/routes/user.rs b/src/routes/user.rs index de635b50..ec640293 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -9,7 +9,6 @@ use rocket::{ response::{status, Content, Flash, Redirect}, }; use rocket_i18n::I18n; -use serde_json; use std::{borrow::Cow, collections::HashMap}; use tracing::{info, warn}; use validator::{Validate, ValidationError, ValidationErrors}; diff --git a/src/routes/well_known.rs b/src/routes/well_known.rs index 723ec1e0..1246dc97 100644 --- a/src/routes/well_known.rs +++ b/src/routes/well_known.rs @@ -1,6 +1,5 @@ use rocket::http::ContentType; use rocket::response::Content; -use serde_json; use webfinger::*; use plume_models::{ap_url, blogs::Blog, users::User, PlumeRocket, CONFIG};