chore(fmt): Format the code

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-05-26 18:49:15 +03:00
parent 25d94ccc40
commit 9100ebcb11
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F
2 changed files with 8 additions and 7 deletions

View file

@ -23,17 +23,17 @@ use crate::PingList;
#[derive(Debug)]
pub(crate) struct AppState {
/// Clean text bot usernames
pub bots: Vec<String>,
pub bots: Vec<String>,
/// Sha256 tokens
pub tokens: Vec<String>,
/// The telegram clinet
tg_client: grammers_client::Client,
tg_client: grammers_client::Client,
}
#[derive(serde::Serialize)]
struct MessageSchema<'a> {
message: &'a str,
status: bool,
message: &'a str,
status: bool,
#[serde(skip)]
status_code: StatusCode,
}
@ -46,11 +46,11 @@ impl AppState {
client: grammers_client::Client,
) -> Self {
Self {
bots: bots
bots: bots
.into_iter()
.map(|b| b.trim_start_matches('@').trim().to_lowercase())
.collect(),
tokens: tokens
tokens: tokens
.into_iter()
.map(|t| sha256::digest(t.trim()))
.collect(),

View file

@ -25,7 +25,7 @@ mod superbot;
#[derive(Default, Clone)]
pub(crate) struct PingedBot {
telegram_id: u64,
ping_in: i64,
ping_in: i64,
is_response: bool,
}
@ -64,6 +64,7 @@ impl PingList for Mutex<Vec<PingedBot>> {
log::debug!("Response status: {result}");
result
}
fn new_res(&self, telegram_id: u64) {
log::debug!("New res from: {telegram_id}");
let mut bots = self.lock().unwrap();