mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-10-18 19:31:59 +00:00
chore: Fix nightly-only clippy lints
This commit is contained in:
parent
baa89586e2
commit
72b78ed6d4
6 changed files with 24 additions and 33 deletions
|
@ -29,20 +29,19 @@ impl crate::Service for Service {
|
|||
let db = Data::new(&args);
|
||||
let config = &args.server.config;
|
||||
|
||||
let turn_secret =
|
||||
config
|
||||
.turn_secret_file
|
||||
.as_ref()
|
||||
.map_or(config.turn_secret.clone(), |path| {
|
||||
std::fs::read_to_string(path).unwrap_or_else(|e| {
|
||||
error!("Failed to read the TURN secret file: {e}");
|
||||
let turn_secret = config.turn_secret_file.as_ref().map_or_else(
|
||||
|| config.turn_secret.clone(),
|
||||
|path| {
|
||||
std::fs::read_to_string(path).unwrap_or_else(|e| {
|
||||
error!("Failed to read the TURN secret file: {e}");
|
||||
|
||||
config.turn_secret.clone()
|
||||
})
|
||||
});
|
||||
config.turn_secret.clone()
|
||||
})
|
||||
},
|
||||
);
|
||||
|
||||
let registration_token = config.registration_token_file.as_ref().map_or(
|
||||
config.registration_token.clone(),
|
||||
let registration_token = config.registration_token_file.as_ref().map_or_else(
|
||||
|| config.registration_token.clone(),
|
||||
|path| {
|
||||
let Ok(token) = std::fs::read_to_string(path).inspect_err(|e| {
|
||||
error!("Failed to read the registration token file: {e}");
|
||||
|
|
|
@ -439,13 +439,7 @@ impl Service {
|
|||
notifi.counts = NotificationCounts::default();
|
||||
}
|
||||
|
||||
if event_id_only {
|
||||
self.send_request(
|
||||
&http.url,
|
||||
send_event_notification::v1::Request::new(notifi),
|
||||
)
|
||||
.await?;
|
||||
} else {
|
||||
if !event_id_only {
|
||||
if *event.kind() == TimelineEventType::RoomEncrypted
|
||||
|| tweaks
|
||||
.iter()
|
||||
|
@ -480,14 +474,11 @@ impl Service {
|
|||
.get_canonical_alias(event.room_id())
|
||||
.await
|
||||
.ok();
|
||||
|
||||
self.send_request(
|
||||
&http.url,
|
||||
send_event_notification::v1::Request::new(notifi),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
self.send_request(&http.url, send_event_notification::v1::Request::new(notifi))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
},
|
||||
// TODO: Handle email
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue