1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Readability fixes for cargo clippy

This commit is contained in:
NG (Graham)
2025-09-03 22:33:26 -04:00
parent 9dcb12131b
commit 0e35aced01
77 changed files with 725 additions and 735 deletions

View File

@@ -24,7 +24,7 @@ impl <C: Send + 'static> SimpleOperation<C> for PublicMessageSender {
if let Some(Typed::Str(channel_name)) = params.remove(&CHANNEL_NAME_PARAM_KEY) {
if let Some(Typed::Str(message_text)) = params.remove(&MESSAGE_TEXT_PARAM_KEY) {
let user = user.user()?;
if message_text.string.bytes().len() > MAX_MESSAGE_LEN {
if message_text.string.len() > MAX_MESSAGE_LEN {
log::warn!("Rejecting too long chat message from {}", user.public_id());
return Err((oj_rc_core::data::error_codes::ChatErrorCodes::Flood as i16).into())
}
@@ -65,7 +65,7 @@ impl <C: Send + 'static> SimpleOperation<C> for PrivateMessageSender {
if let Some(Typed::Str(username)) = params.remove(&USERNAME_PARAM_KEY) {
if let Some(Typed::Str(message_text)) = params.remove(&MESSAGE_TEXT_PARAM_KEY) {
let user = user.user()?;
if message_text.string.bytes().len() > MAX_MESSAGE_LEN {
if message_text.string.len() > MAX_MESSAGE_LEN {
log::warn!("Rejecting too long chat message from {}", user.public_id());
return Err((oj_rc_core::data::error_codes::ChatErrorCodes::Flood as i16).into())
}