ran cargo fix

This commit is contained in:
Kai Jan Kriegel 2022-04-26 23:21:43 +02:00
parent ba99f6f131
commit df64d43e03
21 changed files with 43 additions and 44 deletions

View File

@ -1,7 +1,7 @@
use std::collections::HashMap;
use futures_util::future;
use futures_util::future::BoxFuture;
use rkyv::Archived;
use crate::actors::Actor;
use crate::db::ArchivedValue;
use crate::resources::state::State;

View File

@ -6,7 +6,7 @@ use executor::pool::Executor;
use futures_signals::signal::{Signal};
use futures_util::future::BoxFuture;
use rumqttc::{AsyncClient, ConnectionError, Event, Incoming, MqttOptions};
use std::cell::Cell;
use std::collections::HashMap;
use std::future::Future;
@ -17,7 +17,7 @@ use std::time::Duration;
use once_cell::sync::Lazy;
use rumqttc::ConnectReturnCode::Success;
use rumqttc::Packet::ConnAck;
use rustls::{RootCertStore};
use url::Url;
use crate::actors::dummy::Dummy;

View File

@ -1,7 +1,7 @@
use std::collections::HashMap;
use std::process::{Command, Stdio};
use futures_util::future::BoxFuture;
use rkyv::Archived;
use crate::actors::Actor;
use crate::db::ArchivedValue;
use crate::resources::modules::fabaccess::ArchivedStatus;

View File

@ -1,6 +1,6 @@
use std::collections::HashMap;
use futures_util::future::BoxFuture;
use rkyv::Archived;
use rumqttc::{AsyncClient, QoS};
use crate::actors::Actor;
use crate::db::ArchivedValue;

View File

@ -12,7 +12,7 @@ use std::convert::TryFrom;
use std::sync::Arc;
use desfire::desfire::desfire::MAX_BYTES_PER_TRANSACTION;
use rsasl::property::AuthId;
use tracing::{error, trace};
use crate::authentication::fabfire::FabFireCardKey;
enum FabFireError {
@ -606,7 +606,7 @@ impl Authentication for FabFire {
}
};
}
Err(e) => {
Err(_e) => {
tracing::error!("Got invalid response: {:?}", apdu_response);
return Err(FabFireError::InvalidCredentials(format!("{}", apdu_response)).into());
}

View File

@ -7,7 +7,7 @@ use rsasl::session::{Session, SessionData};
use rsasl::validate::{validations, Validation};
use rsasl::{Property, SASL};
use std::sync::Arc;
use rsasl::registry::Mechanism;
use crate::authentication::fabfire::FabFireCardKey;
mod fabfire;

View File

@ -88,7 +88,7 @@ impl Machine {
pub fn optional_build(session: SessionHandle, resource: Resource, builder: optional::Builder<machine::Owned>) {
let this = Self::new(session.clone(), resource.clone());
if this.resource.visible(&session) || session.has_read(&resource) {
let mut builder = builder.init_just();
let builder = builder.init_just();
this.build_into(builder);
}
}

View File

@ -24,12 +24,12 @@ impl User {
pub fn build_optional(&self, user: Option<UserRef>, builder: optional::Builder<user::Owned>) {
if let Some(user) = user.and_then(|u| self.session.users.get_user(u.get_username())) {
let mut builder = builder.init_just();
let builder = builder.init_just();
self.fill(user, builder);
}
}
pub fn build(session: SessionHandle, mut builder: user::Builder) {
pub fn build(session: SessionHandle, builder: user::Builder) {
let this = Self::new_self(session);
let user = this.session.get_user();
this.fill(user, builder);
@ -74,8 +74,8 @@ impl info::Server for User {
impl manage::Server for User {
fn pwd(
&mut self,
params: manage::PwdParams,
mut results: manage::PwdResults,
_params: manage::PwdParams,
_results: manage::PwdResults,
) -> Promise<(), ::capnp::Error> {
Promise::err(::capnp::Error::unimplemented(
"method not implemented".to_string(),

View File

@ -2,13 +2,12 @@ use capnp::capability::Promise;
use capnp_rpc::pry;
use api::usersystem_capnp::user_system::{
info, manage,
self as system,
};
use crate::authorization::permissions::Permission;
use crate::capnp::user::User;
use crate::session::SessionHandle;
use crate::users::UserRef;
#[derive(Clone)]
pub struct Users {

View File

@ -1,12 +1,12 @@
use std::default::Default;
use std::path::{Path, PathBuf};
use std::path::{PathBuf};
use std::collections::HashMap;
use serde::{Serialize, Deserialize};
use std::fmt::Formatter;
use std::net::{ToSocketAddrs};
use serde_dhall::StaticType;
mod dhall;

View File

@ -1,10 +1,10 @@
use crate::db::RawDB;
use lmdb::{Cursor, RwTransaction, Transaction, WriteFlags};
use rkyv::{AlignedVec, Archive, Archived, Serialize};
use rkyv::{AlignedVec, Archive, Archived};
use std::fmt;
use std::fmt::{Debug, Display, Formatter};
use std::marker::PhantomData;
use std::pin::Pin;
use crate::db;
#[derive(Clone)]

View File

@ -1,5 +1,5 @@
use tracing_subscriber::{EnvFilter};
use crate::Config;
use serde::{Serialize, Deserialize};

View File

@ -1,8 +1,8 @@
use rkyv::Infallible;
use std::ops::Deref;
use std::sync::Arc;
use futures_signals::signal::{Mutable, Signal, SignalExt};
use lmdb::RoTransaction;
use futures_signals::signal::{Mutable, Signal};
use rkyv::{Archived, Deserialize};
use rkyv::option::ArchivedOption;
use rkyv::ser::Serializer;

View File

@ -1,5 +1,5 @@
use std::fmt;
use std::fmt::{Write, write};
use std::fmt::{Write};
use crate::utils::oid::ObjectIdentifier;
use once_cell::sync::Lazy;
use rkyv::{Archive, Archived, Deserialize, Infallible};

View File

@ -1,7 +1,7 @@
use crate::db;
use crate::db::{ArchivedValue, RawDB, DB, AlignedAdapter};
use lmdb::{
DatabaseFlags, Environment, EnvironmentFlags, RoTransaction, RwTransaction, Transaction,
DatabaseFlags, Environment, EnvironmentFlags, Transaction,
WriteFlags,
};
use std::{path::Path, sync::Arc};

View File

@ -5,11 +5,11 @@ use std::{
},
};
use std::fmt::{Debug, Display, Formatter};
use std::marker::PhantomData;
use std::ops::Deref;
use std::sync::Arc;
use rkyv::{AlignedVec, Archive, Archived, Deserialize, out_field, Serialize};
use std::ops::Deref;
use rkyv::{Archive, Deserialize, out_field, Serialize};
use serde::de::{Error, MapAccess, Unexpected};
use serde::Deserializer;
use serde::ser::SerializeMap;

View File

@ -1,8 +1,8 @@
use std::{any::Any, fmt, hash::Hash, ptr, str::FromStr};
use std::{hash::Hash};
use ptr_meta::{DynMetadata, Pointee};
use rkyv::{out_field, Archive, ArchivePointee, ArchiveUnsized, Archived, ArchivedMetadata, Deserialize, DeserializeUnsized, Fallible, Serialize, SerializeUnsized, RelPtr};
use rkyv_dyn::{DynDeserializer, DynError, DynSerializer};
use rkyv::{out_field, Archive, ArchivePointee, ArchiveUnsized, Archived, ArchivedMetadata, Serialize, SerializeUnsized, RelPtr};
use rkyv_dyn::{DynError, DynSerializer};
use crate::utils::oid::ObjectIdentifier;
@ -11,15 +11,15 @@ use crate::utils::oid::ObjectIdentifier;
use inventory;
use rkyv::ser::{ScratchSpace, Serializer};
use serde::de::Error as SerdeError;
use serde::ser::SerializeMap;
use std::alloc::Layout;
use std::collections::HashMap;
use std::fmt::Formatter;
use std::mem::MaybeUninit;
use std::ops::Deref;
use std::sync::atomic::{AtomicUsize, Ordering};
use rkyv::boxed::{ArchivedBox, BoxResolver};
use rkyv::vec::ArchivedVec;
#[repr(transparent)]

View File

@ -2,7 +2,7 @@
use once_cell::sync::OnceCell;
use crate::authorization::permissions::Permission;
use crate::authorization::roles::{Roles};
use crate::resources::Resource;

View File

@ -9,7 +9,7 @@ use rustls::{Certificate, PrivateKey, ServerConfig, SupportedCipherSuite};
use rustls::version::{TLS12, TLS13};
use tracing::{Level};
use crate::capnp::TlsListen;
use crate::config;
use crate::keylog::KeyLogFile;

View File

@ -5,7 +5,7 @@ use rkyv::Infallible;
use std::sync::Arc;
use anyhow::Context;
use rkyv::{Archived, Deserialize};
use rkyv::{Deserialize};
use rkyv::ser::Serializer;
use rkyv::ser::serializers::AllocSerializer;
use crate::db;
@ -118,7 +118,7 @@ impl UserDB {
pub fn get_all(&self) -> Result<Vec<(String, User)>, db::Error> {
let txn = self.env.begin_ro_txn()?;
let mut iter = self.db.get_all(&txn)?;
let iter = self.db.get_all(&txn)?;
let mut out = Vec::new();
for (uid, user) in iter {
let uid = unsafe { std::str::from_utf8_unchecked(uid).to_string() };

View File

@ -4,7 +4,7 @@ use once_cell::sync::OnceCell;
use rkyv::{Archive, Deserialize, Infallible, Serialize};
use std::collections::HashMap;
use std::fmt::{Display, Formatter, Write};
use std::ops::Deref;
use std::path::Path;
use std::sync::Arc;