Skip to content

Commit b78e0db

Browse files
committed
Edition 2024
1 parent c068a98 commit b78e0db

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "carapax"
33
description = "A Telegram Bot Framework"
44
version = "0.29.0"
55
authors = ["Ross Nomann <rossnomann@protonmail.com>"]
6-
edition = "2021"
6+
edition = "2024"
77
readme = "./README.md"
88
license = "MIT"
99
documentation = "https://docs.rs/carapax"

src/access/principal/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl Resolver for UserId {
9494
fn accepts(&self, update: &Update) -> bool {
9595
match self {
9696
UserId::Id(user_id) => update.get_user().map(|u| u.id == *user_id),
97-
UserId::Username(ref username) => update
97+
UserId::Username(username) => update
9898
.get_user()
9999
.and_then(|u| u.username.as_ref().map(|x| x == username)),
100100
}
@@ -106,7 +106,7 @@ impl Resolver for ChatId {
106106
fn accepts(&self, update: &Update) -> bool {
107107
match self {
108108
ChatId::Id(chat_id) => update.get_chat_id().map(|x| x == *chat_id),
109-
ChatId::Username(ref chat_username) => update.get_chat_username().map(|x| x == chat_username),
109+
ChatId::Username(chat_username) => update.get_chat_username().map(|x| x == chat_username),
110110
}
111111
.unwrap_or(false)
112112
}

src/core/app/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ where
4949
}
5050
}
5151

52-
fn handle_update(&self, update: Update) -> impl Future<Output = ()> {
52+
fn handle_update(&self, update: Update) -> impl Future<Output = ()> + use<H, HI, HO> {
5353
let input = HandlerInput {
5454
update,
5555
context: self.context.clone(),

src/core/chain/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl Chain {
6868
self
6969
}
7070

71-
fn handle_input(&self, input: HandlerInput) -> impl Future<Output = HandlerResult> {
71+
fn handle_input(&self, input: HandlerInput) -> impl Future<Output = HandlerResult> + use<> {
7272
let handlers = self.handlers.clone();
7373
let strategy = self.strategy;
7474
async move {

src/core/predicate/base/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ where
5151

5252
async fn handle(&self, (predicate_input, handler_input): (PI, HI)) -> Self::Output {
5353
let predicate_result = self.predicate.handle(predicate_input).await.into();
54-
if let PredicateResult::True = predicate_result {
54+
match predicate_result { PredicateResult::True => {
5555
self.handler.handle(handler_input).await.into_result().into()
56-
} else {
56+
} _ => {
5757
predicate_result.into()
58-
}
58+
}}
5959
}
6060
}
6161

src/ratelimit/key.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ impl TryFromInput for KeyChatUser {
7272
type Error = Infallible;
7373

7474
async fn try_from_input(input: HandlerInput) -> Result<Option<Self>, Self::Error> {
75-
Ok(if let Some(chat_id) = input.update.get_chat_id() {
75+
Ok(match input.update.get_chat_id() { Some(chat_id) => {
7676
input.update.get_user().map(|user| Self(chat_id, user.id))
77-
} else {
77+
} _ => {
7878
None
79-
})
79+
}})
8080
}
8181
}
8282

0 commit comments

Comments
 (0)