Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes #418

Merged
merged 12 commits into from
Jun 7, 2024
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ incremental = false

[workspace.lints.rust]
absolute-paths-not-starting-with-crate = "warn"
#box-pointers = "warn" # TODO
#box-pointers = "warn"
deprecated-in-future = "warn"
elided-lifetimes-in-paths = "warn"
explicit-outlives-requirements = "warn"
Expand All @@ -662,7 +662,7 @@ rust-2021-incompatible-or-patterns = "warn"
rust-2021-prefixes-incompatible-syntax = "warn"
rust-2021-prelude-collisions = "warn"
single-use-lifetimes = "warn"
#trivial-casts = "warn" # TODO
trivial-casts = "warn"
trivial-numeric-casts = "warn"
unit-bindings = "warn"
#unnameable-types = "warn" # TODO
Expand Down Expand Up @@ -711,9 +711,8 @@ correctness = "warn"
###################
nursery = "warn"

### some sadness
## some sadness
branches_sharing_code = { level = "allow", priority = 1 } # TODO
cognitive_complexity = { level = "allow", priority = 1 } # TODO
derive_partial_eq_without_eq = { level = "allow", priority = 1 } # TODO
equatable_if_let = { level = "allow", priority = 1 } # TODO
future_not_send = { level = "allow", priority = 1 } # TODO
Expand Down
8 changes: 7 additions & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
too-many-lines-threshold = 700
array-size-threshold = 4096
cognitive-complexity-threshold = 94 # TODO reduce me ALARA
excessive-nesting-threshold = 11 # TODO reduce me to 4 or 5
future-size-threshold = 7745 # TODO reduce me ALARA
stack-size-threshold = 178030 # reduce me ALARA
too-many-lines-threshold = 700 # TODO reduce me to <= 100
type-complexity-threshold = 250 # reduce me to ~200
2 changes: 1 addition & 1 deletion src/admin/room/room_moderation_commands.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt::Write;

use api::client_server::{get_alias_helper, leave_room};
use api::client::{get_alias_helper, leave_room};
use ruma::{
events::room::message::RoomMessageEventContent, OwnedRoomId, OwnedUserId, RoomAliasId, RoomId, RoomOrAliasId,
};
Expand Down
2 changes: 1 addition & 1 deletion src/admin/user/user_commands.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{fmt::Write as _, sync::Arc};

use api::client_server::{join_room_by_id_helper, leave_all_rooms};
use api::client::{join_room_by_id_helper, leave_all_rooms};
use conduit::utils;
use ruma::{events::room::message::RoomMessageEventContent, OwnedRoomId, UserId};
use tracing::{error, info, warn};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ use ruma::{
};
use tracing::{error, info, warn};

use super::{DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH};
use super::{join_room_by_id_helper, DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH};
use crate::{
client_server::{self, join_room_by_id_helper},
service::user_is_local,
services,
utils::{self},
Expand Down Expand Up @@ -539,7 +538,7 @@ pub(crate) async fn deactivate_route(body: Ruma<deactivate::v3::Request>) -> Res
}

// Make the user leave all rooms before deactivation
client_server::leave_all_rooms(sender_user).await;
super::leave_all_rooms(sender_user).await;

// Remove devices and mark account as deactivated
services().users.deactivate_account(sender_user)?;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/api/client_server/room.rs → src/api/client/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use ruma::{
use serde_json::{json, value::to_raw_value};
use tracing::{error, info, warn};

use super::invite_helper;
use crate::{
client_server::invite_helper,
service::{appservice::RegistrationInfo, pdu::PduBuilder},
services, Error, Result, Ruma,
};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
pub mod client_server;
pub mod client;
pub mod router;
mod ruma_wrapper;
pub mod server;

extern crate conduit_core as conduit;
extern crate conduit_service as service;

pub use client_server::membership::{join_room_by_id_helper, leave_all_rooms};
pub(crate) use conduit::{debug_info, debug_warn, utils, Error, Result};
pub(crate) use ruma_wrapper::{Ruma, RumaResponse};
pub(crate) use service::{pdu::PduEvent, services, user_is_local};
Expand Down
Loading