fix more clippy lints (part 1)

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-01-14 22:39:08 -05:00 committed by June
parent 44440f745f
commit 59c7f93656
19 changed files with 77 additions and 80 deletions

View file

@ -1,6 +1,6 @@
mod data;
pub use data::Data;
pub(crate) use data::Data;
use ruma::{
events::{AnyEphemeralRoomEvent, RoomAccountDataEventType},

View file

@ -1,6 +1,6 @@
mod data;
pub use data::Data;
pub(crate) use data::Data;
use crate::Result;

View file

@ -75,7 +75,7 @@ pub struct Service<'a> {
pub roomid_mutex_federation: RwLock<HashMap<OwnedRoomId, Arc<TokioMutex<()>>>>, // this lock will be held longer
pub roomid_federationhandletime: RwLock<HashMap<OwnedRoomId, (OwnedEventId, Instant)>>,
pub stateres_mutex: Arc<Mutex<()>>,
pub rotate: RotationHandler,
pub(crate) rotate: RotationHandler,
pub shutdown: AtomicBool,
pub argon: Argon2<'a>,
@ -84,12 +84,12 @@ pub struct Service<'a> {
/// Handles "rotation" of long-polling requests. "Rotation" in this context is similar to "rotation" of log files and the like.
///
/// This is utilized to have sync workers return early and release read locks on the database.
pub struct RotationHandler(broadcast::Sender<()>, broadcast::Receiver<()>);
pub(crate) struct RotationHandler(broadcast::Sender<()>, ());
impl RotationHandler {
pub fn new() -> Self {
let (s, r) = broadcast::channel(1);
Self(s, r)
let (s, _r) = broadcast::channel(1);
Self(s, ())
}
pub fn watch(&self) -> impl Future<Output = ()> {
@ -113,13 +113,13 @@ impl Default for RotationHandler {
type DnsOverrides = Box<dyn Fn(&str) -> Option<SocketAddr> + Send + Sync>;
pub struct Resolver {
struct Resolver {
inner: GaiResolver,
overrides: DnsOverrides,
}
impl Resolver {
pub fn new(overrides: DnsOverrides) -> Resolver {
fn new(overrides: DnsOverrides) -> Resolver {
Resolver {
inner: GaiResolver::new(),
overrides,

View file

@ -1,5 +1,5 @@
mod data;
pub use data::Data;
pub(crate) use data::Data;
use crate::Result;
use ruma::{

View file

@ -1,7 +1,7 @@
mod data;
use std::io::Cursor;
pub use data::Data;
pub(crate) use data::Data;
use crate::{services, Result};
use image::imageops::FilterType;

View file

@ -7,19 +7,19 @@ use lru_cache::LruCache;
use crate::{Config, Result};
pub mod account_data;
pub mod admin;
pub mod appservice;
pub mod globals;
pub mod key_backups;
pub mod media;
pub mod pdu;
pub mod pusher;
pub mod rooms;
pub mod sending;
pub mod transaction_ids;
pub mod uiaa;
pub mod users;
pub(crate) mod account_data;
pub(crate) mod admin;
pub(crate) mod appservice;
pub(crate) mod globals;
pub(crate) mod key_backups;
pub(crate) mod media;
pub(crate) mod pdu;
pub(crate) mod pusher;
pub(crate) mod rooms;
pub(crate) mod sending;
pub(crate) mod transaction_ids;
pub(crate) mod uiaa;
pub(crate) mod users;
pub struct Services<'a> {
pub appservice: appservice::Service,