From b82bfa42f32eb43e613c6f619744a55cfe747f05 Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Sat, 9 Nov 2024 13:01:26 +0100 Subject: [PATCH] remove unused imports from bffhd --- bffhd/actors/mod.rs | 2 +- bffhd/authentication/fabfire/server.rs | 2 -- bffhd/authentication/fabfire_bin/server.rs | 2 -- bffhd/capnp/authenticationsystem.rs | 2 -- bffhd/capnp/mod.rs | 4 ++-- bffhd/capnp/permissionsystem.rs | 1 - bffhd/config/dhall.rs | 5 +---- bffhd/db/mod.rs | 4 ++-- bffhd/db/raw.rs | 1 - bffhd/error.rs | 2 +- bffhd/initiators/dummy.rs | 2 -- bffhd/initiators/mod.rs | 9 +-------- bffhd/initiators/process.rs | 3 +-- bffhd/lib.rs | 2 -- bffhd/logging.rs | 3 +-- bffhd/resources/modules/fabaccess.rs | 1 - bffhd/resources/state/db.rs | 6 ++---- bffhd/resources/state/mod.rs | 2 +- bffhd/resources/state/value.rs | 2 -- bffhd/users/db.rs | 1 - bffhd/users/mod.rs | 3 +-- 21 files changed, 14 insertions(+), 45 deletions(-) diff --git a/bffhd/actors/mod.rs b/bffhd/actors/mod.rs index e56c0e9..bd8facf 100644 --- a/bffhd/actors/mod.rs +++ b/bffhd/actors/mod.rs @@ -12,7 +12,7 @@ use std::future::Future; use std::pin::Pin; -use miette::{Diagnostic, IntoDiagnostic}; +use miette::Diagnostic; use std::task::{Context, Poll}; use std::time::Duration; use thiserror::Error; diff --git a/bffhd/authentication/fabfire/server.rs b/bffhd/authentication/fabfire/server.rs index ea1a8a5..f8fc366 100644 --- a/bffhd/authentication/fabfire/server.rs +++ b/bffhd/authentication/fabfire/server.rs @@ -2,7 +2,6 @@ use desfire::desfire::desfire::MAX_BYTES_PER_TRANSACTION; use desfire::desfire::Desfire; use desfire::error::Error as DesfireError; use desfire::iso7816_4::apduresponse::APDUResponse; -use rsasl::callback::SessionData; use rsasl::mechanism::{ Authentication, Demand, DemandReply, MechanismData, MechanismError, MechanismErrorKind, Provider, State, ThisProvider, @@ -13,7 +12,6 @@ use serde::{Deserialize, Serialize}; use std::convert::TryFrom; use std::fmt::{Debug, Display, Formatter}; use std::io::Write; -use std::sync::Arc; use crate::authentication::fabfire::FabFireCardKey; diff --git a/bffhd/authentication/fabfire_bin/server.rs b/bffhd/authentication/fabfire_bin/server.rs index e183f2b..cec1b66 100644 --- a/bffhd/authentication/fabfire_bin/server.rs +++ b/bffhd/authentication/fabfire_bin/server.rs @@ -2,7 +2,6 @@ use desfire::desfire::desfire::MAX_BYTES_PER_TRANSACTION; use desfire::desfire::Desfire; use desfire::error::Error as DesfireError; use desfire::iso7816_4::apduresponse::APDUResponse; -use rsasl::callback::SessionData; use rsasl::mechanism::{ Authentication, Demand, DemandReply, MechanismData, MechanismError, MechanismErrorKind, Provider, State, ThisProvider, @@ -13,7 +12,6 @@ use serde::{Deserialize, Serialize}; use std::convert::TryFrom; use std::fmt::{Debug, Display, Formatter}; use std::io::Write; -use std::sync::Arc; use crate::authentication::fabfire::FabFireCardKey; use crate::CONFIG; diff --git a/bffhd/capnp/authenticationsystem.rs b/bffhd/capnp/authenticationsystem.rs index c81f547..88185e3 100644 --- a/bffhd/capnp/authenticationsystem.rs +++ b/bffhd/capnp/authenticationsystem.rs @@ -4,10 +4,8 @@ use capnp_rpc::pry; use rsasl::mechname::Mechname; use rsasl::prelude::State as SaslState; use rsasl::prelude::{MessageSent, Session}; -use rsasl::property::AuthId; use std::fmt; use std::fmt::{Formatter, Write}; -use std::io::Cursor; use tracing::Span; use crate::authentication::V; diff --git a/bffhd/capnp/mod.rs b/bffhd/capnp/mod.rs index 523e921..55f3140 100644 --- a/bffhd/capnp/mod.rs +++ b/bffhd/capnp/mod.rs @@ -5,11 +5,11 @@ use async_net::TcpListener; use capnp_rpc::rpc_twoparty_capnp::Side; use capnp_rpc::twoparty::VatNetwork; use capnp_rpc::RpcSystem; -use executor::prelude::{Executor, GroupId, SupervisionRegistry}; +use executor::prelude::{Executor, SupervisionRegistry}; use futures_rustls::server::TlsStream; use futures_rustls::TlsAcceptor; use futures_util::stream::FuturesUnordered; -use futures_util::{stream, AsyncRead, AsyncWrite, FutureExt, StreamExt}; +use futures_util::{stream, AsyncRead, AsyncWrite, StreamExt}; use std::future::Future; use std::io; diff --git a/bffhd/capnp/permissionsystem.rs b/bffhd/capnp/permissionsystem.rs index 6e8eac3..4506aa4 100644 --- a/bffhd/capnp/permissionsystem.rs +++ b/bffhd/capnp/permissionsystem.rs @@ -1,4 +1,3 @@ -use crate::authorization::roles::Role; use crate::Roles; use api::permissionsystem_capnp::permission_system::info::{ GetRoleListParams, GetRoleListResults, Server as PermissionSystem, diff --git a/bffhd/config/dhall.rs b/bffhd/config/dhall.rs index 8f04d04..557cd49 100644 --- a/bffhd/config/dhall.rs +++ b/bffhd/config/dhall.rs @@ -1,8 +1,6 @@ use std::collections::HashMap; use std::default::Default; -use std::error::Error; -use std::fmt::{Debug, Display}; -use std::marker::PhantomData; +use std::fmt::Debug; use std::path::PathBuf; use serde::{Deserialize, Serialize}; @@ -12,7 +10,6 @@ use crate::authorization::roles::Role; use crate::capnp::{Listen, TlsListen}; use crate::logging::LogConfig; -use miette::IntoDiagnostic; use std::path::Path; #[derive(Debug)] diff --git a/bffhd/db/mod.rs b/bffhd/db/mod.rs index 0ceb684..23701aa 100644 --- a/bffhd/db/mod.rs +++ b/bffhd/db/mod.rs @@ -2,9 +2,9 @@ use thiserror::Error; mod raw; -use miette::{Diagnostic, LabeledSpan, Severity, SourceCode}; +use miette::{Diagnostic, Severity}; pub use raw::RawDB; -use std::fmt::{Debug, Display, Formatter}; +use std::fmt::{Debug, Display}; mod typed; pub use typed::{Adapter, AlignedAdapter, ArchivedValue, DB}; diff --git a/bffhd/db/raw.rs b/bffhd/db/raw.rs index 9ec84dd..fc24f40 100644 --- a/bffhd/db/raw.rs +++ b/bffhd/db/raw.rs @@ -1,4 +1,3 @@ -use super::Result; use lmdb::{DatabaseFlags, Environment, RwTransaction, Transaction, WriteFlags}; #[derive(Debug, Clone)] diff --git a/bffhd/error.rs b/bffhd/error.rs index e0af43b..b51385a 100644 --- a/bffhd/error.rs +++ b/bffhd/error.rs @@ -1,4 +1,4 @@ -use miette::{Diagnostic, LabeledSpan, Severity, SourceCode}; +use miette::{Diagnostic, Severity}; use std::error; use std::fmt::{Display, Formatter}; use std::io; diff --git a/bffhd/initiators/dummy.rs b/bffhd/initiators/dummy.rs index 1fd2a3e..c002e7e 100644 --- a/bffhd/initiators/dummy.rs +++ b/bffhd/initiators/dummy.rs @@ -5,11 +5,9 @@ use super::Initiator; use crate::initiators::InitiatorCallbacks; use crate::resources::modules::fabaccess::Status; use crate::session::SessionHandle; -use crate::users::UserRef; use async_io::Timer; use futures_util::future::BoxFuture; use futures_util::ready; -use lmdb::Stat; use std::collections::HashMap; use std::future::Future; use std::mem; diff --git a/bffhd/initiators/mod.rs b/bffhd/initiators/mod.rs index c5cf613..ba32c45 100644 --- a/bffhd/initiators/mod.rs +++ b/bffhd/initiators/mod.rs @@ -3,22 +3,15 @@ use crate::initiators::process::Process; use crate::resources::modules::fabaccess::Status; use crate::session::SessionHandle; use crate::{ - AuthenticationHandle, Config, MachineState, Resource, ResourcesHandle, SessionManager, + AuthenticationHandle, Config, Resource, ResourcesHandle, SessionManager, }; -use async_compat::CompatExt; use executor::prelude::Executor; use futures_util::ready; -use miette::IntoDiagnostic; -use rumqttc::ConnectReturnCode::Success; -use rumqttc::{AsyncClient, ConnectionError, Event, Incoming, MqttOptions}; use std::collections::HashMap; -use std::fmt::Display; use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; -use std::time::Duration; use tracing::Span; -use url::Url; mod dummy; mod process; diff --git a/bffhd/initiators/process.rs b/bffhd/initiators/process.rs index 79f6bde..814e1a8 100644 --- a/bffhd/initiators/process.rs +++ b/bffhd/initiators/process.rs @@ -1,10 +1,9 @@ use super::Initiator; use super::InitiatorCallbacks; use crate::resources::modules::fabaccess::Status; -use crate::resources::state::State; use crate::utils::linebuffer::LineBuffer; use async_process::{Child, ChildStderr, ChildStdout, Command, Stdio}; -use futures_lite::{ready, AsyncRead}; +use futures_lite::AsyncRead; use miette::{miette, IntoDiagnostic}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/bffhd/lib.rs b/bffhd/lib.rs index 8e24c15..84b8a31 100644 --- a/bffhd/lib.rs +++ b/bffhd/lib.rs @@ -9,7 +9,6 @@ //! The entry point of bffhd can be found in [bin/bffhd/main.rs](../bin/bffhd/main.rs) use miette::Diagnostic; -use std::io; use thiserror::Error; pub mod config; @@ -48,7 +47,6 @@ mod tls; use std::sync::Arc; use futures_util::{FutureExt, StreamExt}; -use miette::{Context, IntoDiagnostic, Report}; use once_cell::sync::OnceCell; use crate::audit::AuditLog; diff --git a/bffhd/logging.rs b/bffhd/logging.rs index 1fdb2c6..8b9d043 100644 --- a/bffhd/logging.rs +++ b/bffhd/logging.rs @@ -2,8 +2,7 @@ use serde::{Deserialize, Serialize}; use std::path::Path; use tracing_subscriber::fmt::format::Format; use tracing_subscriber::prelude::*; -use tracing_subscriber::reload::Handle; -use tracing_subscriber::{reload, EnvFilter}; +use tracing_subscriber::EnvFilter; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct LogConfig { diff --git a/bffhd/resources/modules/fabaccess.rs b/bffhd/resources/modules/fabaccess.rs index b50e9b6..2374d1a 100644 --- a/bffhd/resources/modules/fabaccess.rs +++ b/bffhd/resources/modules/fabaccess.rs @@ -3,7 +3,6 @@ use crate::utils::oid::ObjectIdentifier; use once_cell::sync::Lazy; use rkyv::{Archive, Archived, Deserialize, Infallible}; use std::fmt; -use std::fmt::Write; use std::str::FromStr; //use crate::oidvalue; diff --git a/bffhd/resources/state/db.rs b/bffhd/resources/state/db.rs index 8c2854f..05a9658 100644 --- a/bffhd/resources/state/db.rs +++ b/bffhd/resources/state/db.rs @@ -3,10 +3,8 @@ use thiserror::Error; use crate::db; use crate::db::{AlignedAdapter, ArchivedValue, RawDB, DB}; use lmdb::{DatabaseFlags, Environment, EnvironmentFlags, Transaction, WriteFlags}; -use miette::{Diagnostic, LabeledSpan, Severity, SourceCode}; -use std::any::TypeId; -use std::error::Error; -use std::fmt::{Debug, Display, Formatter}; +use miette::Diagnostic; +use std::fmt::Debug; use std::{path::Path, sync::Arc}; use crate::resources::state::State; diff --git a/bffhd/resources/state/mod.rs b/bffhd/resources/state/mod.rs index 84e3587..efc38c3 100644 --- a/bffhd/resources/state/mod.rs +++ b/bffhd/resources/state/mod.rs @@ -1,5 +1,5 @@ use std::fmt::{Debug, Display, Formatter}; -use std::{fmt, hash::Hasher}; +use std::fmt; use std::ops::Deref; diff --git a/bffhd/resources/state/value.rs b/bffhd/resources/state/value.rs index 9b62e2c..1a087b0 100644 --- a/bffhd/resources/state/value.rs +++ b/bffhd/resources/state/value.rs @@ -14,8 +14,6 @@ use inventory; use rkyv::ser::{ScratchSpace, Serializer}; -use serde::ser::SerializeMap; - use std::collections::HashMap; use std::ops::Deref; diff --git a/bffhd/users/db.rs b/bffhd/users/db.rs index c87449b..32da307 100644 --- a/bffhd/users/db.rs +++ b/bffhd/users/db.rs @@ -2,7 +2,6 @@ use lmdb::{DatabaseFlags, Environment, RwTransaction, Transaction, WriteFlags}; use rkyv::Infallible; use std::collections::HashMap; -use miette::{Context, IntoDiagnostic}; use std::sync::Arc; use crate::db; diff --git a/bffhd/users/mod.rs b/bffhd/users/mod.rs index bd7a7f9..0f6760b 100644 --- a/bffhd/users/mod.rs +++ b/bffhd/users/mod.rs @@ -7,8 +7,7 @@ use std::collections::HashMap; use std::fmt::{Display, Formatter}; use std::io::Write; -use clap::ArgMatches; -use miette::{Context, Diagnostic, IntoDiagnostic, SourceOffset, SourceSpan}; +use miette::{Diagnostic, IntoDiagnostic, SourceSpan}; use std::path::Path; use std::sync::Arc;