cargo fmt

This commit is contained in:
Timo Kösters 2022-10-08 13:03:07 +02:00 committed by Nyaaori
parent d5b4754cf4
commit 7822a385bb
No known key found for this signature in database
GPG key ID: E7819C3ED4D1F82E
29 changed files with 143 additions and 119 deletions

View file

@ -17,12 +17,12 @@ pub trait Data: Send + Sync {
since: u64,
) -> Box<
dyn Iterator<
Item = Result<(
Box<UserId>,
u64,
Raw<ruma::events::AnySyncEphemeralRoomEvent>,
)>,
> + 'a,
Item = Result<(
Box<UserId>,
u64,
Raw<ruma::events::AnySyncEphemeralRoomEvent>,
)>,
> + 'a,
>;
/// Sets a private read marker at `count`.

View file

@ -34,7 +34,7 @@ use ruma::{
state_res::{self, RoomVersion, StateMap},
uint, EventId, MilliSecondsSinceUnixEpoch, RoomId, ServerName, ServerSigningKeyId,
};
use serde_json::value::{RawValue as RawJsonValue};
use serde_json::value::RawValue as RawJsonValue;
use tracing::{debug, error, info, trace, warn};
use crate::{service::*, services, Error, PduEvent, Result};

View file

@ -8,5 +8,5 @@ pub trait Data: Send + Sync {
&'a self,
room_id: &RoomId,
search_string: &str,
) -> Result<Option<(Box<dyn Iterator<Item = Vec<u8>>+ 'a>, Vec<String>)>>;
) -> Result<Option<(Box<dyn Iterator<Item = Vec<u8>> + 'a>, Vec<String>)>>;
}

View file

@ -12,12 +12,7 @@ pub struct Service {
impl Service {
#[tracing::instrument(skip(self))]
pub fn index_pdu<'a>(
&self,
shortroomid: u64,
pdu_id: &[u8],
message_body: &str,
) -> Result<()> {
pub fn index_pdu<'a>(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()> {
self.db.index_pdu(shortroomid, pdu_id, message_body)
}

View file

@ -4,7 +4,7 @@ use std::sync::Arc;
pub use data::Data;
use ruma::{events::StateEventType, EventId, RoomId};
use crate::{Result};
use crate::Result;
pub struct Service {
pub db: &'static dyn Data,

View file

@ -102,7 +102,8 @@ impl Service {
services().rooms.state_cache.update_joined_count(room_id)?;
self.db.set_room_state(room_id, shortstatehash, &state_lock)?;
self.db
.set_room_state(room_id, shortstatehash, &state_lock)?;
drop(state_lock);

View file

@ -5,10 +5,11 @@ pub use data::Data;
use ruma::{
events::{
direct::{DirectEvent},
direct::DirectEvent,
ignored_user_list::IgnoredUserListEvent,
room::{create::RoomCreateEventContent, member::MembershipState},
AnyStrippedStateEvent, AnySyncStateEvent, GlobalAccountDataEventType, RoomAccountDataEventType, StateEventType,
AnyStrippedStateEvent, AnySyncStateEvent, GlobalAccountDataEventType,
RoomAccountDataEventType, StateEventType,
},
serde::Raw,
RoomId, ServerName, UserId,

View file

@ -2,8 +2,8 @@ mod data;
use std::collections::HashMap;
use std::collections::HashSet;
use std::sync::{Arc, Mutex};
use std::{collections::HashSet};
pub use data::Data;
use regex::Regex;
@ -305,7 +305,9 @@ impl Service {
}
for push_key in services().pusher.get_pushkeys(&user) {
services().sending.send_push_pdu(&*pdu_id, &user, push_key?)?;
services()
.sending
.send_push_pdu(&*pdu_id, &user, push_key?)?;
}
}