mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 03:11:32 +00:00
parent
61a02482ff
commit
f6a24e133a
60 changed files with 59 additions and 111 deletions
|
@ -265,8 +265,6 @@ pub async fn local_user_view_from_jwt(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -34,7 +34,7 @@ use lemmy_db_views::structs::LocalUserView;
|
|||
use lemmy_utils::{error::LemmyResult, LemmyErrorType, CACHE_DURATION_API};
|
||||
use serial_test::serial;
|
||||
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
async fn create_test_site(context: &Data<LemmyContext>) -> LemmyResult<(Instance, LocalUserView)> {
|
||||
let pool = &mut context.pool();
|
||||
|
||||
|
@ -109,7 +109,7 @@ async fn signup(
|
|||
Ok((local_user, application))
|
||||
}
|
||||
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
async fn get_application_statuses(
|
||||
context: &Data<LemmyContext>,
|
||||
admin: LocalUserView,
|
||||
|
@ -138,10 +138,9 @@ async fn get_application_statuses(
|
|||
Ok((application_count, unread_applications, all_applications))
|
||||
}
|
||||
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
#[tokio::test]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
async fn test_application_approval() -> LemmyResult<()> {
|
||||
let context = LemmyContext::init_test_context().await;
|
||||
let pool = &mut context.pool();
|
||||
|
|
|
@ -42,7 +42,7 @@ pub async fn get_sitemap(context: Data<LemmyContext>) -> LemmyResult<HttpRespons
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
pub(crate) mod tests {
|
||||
|
||||
use crate::sitemap::generate_urlset;
|
||||
|
|
|
@ -69,8 +69,7 @@ impl Claims {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{claims::Claims, context::LemmyContext};
|
||||
|
|
|
@ -471,8 +471,7 @@ pub async fn replace_image(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -1067,8 +1067,7 @@ fn build_proxied_image_url(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -189,8 +189,6 @@ fn validate_create_payload(local_site: &LocalSite, create_site: &CreateSite) ->
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::site::create::validate_create_payload;
|
||||
|
|
|
@ -48,8 +48,6 @@ fn not_zero(val: Option<i32>) -> Option<i32> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::site::{application_question_check, not_zero, site_default_post_listing_type_check};
|
||||
|
|
|
@ -241,8 +241,6 @@ fn validate_update_payload(local_site: &LocalSite, edit_site: &EditSite) -> Lemm
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::site::update::validate_update_payload;
|
||||
|
|
|
@ -123,7 +123,6 @@ impl InCommunity for AnnouncableActivities {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -307,8 +307,9 @@ where
|
|||
});
|
||||
Ok(failed_items.into_iter().join(","))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::api::user_settings_backup::{export_settings, import_settings, UserSettingsBackup};
|
||||
|
|
|
@ -98,7 +98,7 @@ impl Collection for ApubCommunityModerators {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -120,8 +120,7 @@ pub(crate) async fn get_apub_community_featured(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
pub(crate) mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -75,7 +75,7 @@ impl<S: ValidGrouping<(), IsAggregate = is_aggregate::No>> ValidGrouping<()>
|
|||
type IsAggregate = is_aggregate::No;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
#[expect(non_camel_case_types)]
|
||||
#[derive(QueryId, Clone, Copy, Debug)]
|
||||
pub struct current_value;
|
||||
|
||||
|
|
|
@ -30,8 +30,7 @@ impl CommentAggregates {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -36,8 +36,7 @@ impl CommunityAggregates {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -20,8 +20,7 @@ impl PersonAggregates {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -49,8 +49,8 @@ impl PostAggregates {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -15,8 +15,8 @@ impl SiteAggregates {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -58,8 +58,7 @@ impl ReceivedActivity {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -392,8 +392,8 @@ async fn convert_read_languages(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -51,8 +51,6 @@ impl CaptchaAnswer {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -196,8 +196,7 @@ impl Saveable for CommentSaved {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -431,7 +431,6 @@ impl ApubActor for Community {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
source::{
|
||||
|
|
|
@ -48,8 +48,7 @@ impl FederationAllowList {
|
|||
}
|
||||
}
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -41,8 +41,8 @@ impl Language {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{source::language::Language, utils::build_db_pool_for_tests};
|
||||
|
|
|
@ -369,7 +369,6 @@ pub struct UserBackupLists {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
source::{
|
||||
|
|
|
@ -465,8 +465,7 @@ impl Crud for AdminPurgeComment {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -42,8 +42,6 @@ impl PasswordResetRequest {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -235,7 +235,6 @@ impl PersonFollower {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -392,8 +392,7 @@ impl PostHide {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -80,8 +80,7 @@ impl Reportable for PostReport {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -85,8 +85,7 @@ impl PrivateMessage {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -27,7 +27,6 @@ pub mod newtypes;
|
|||
pub mod sensitive;
|
||||
#[cfg(feature = "full")]
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::wildcard_imports)]
|
||||
pub mod schema;
|
||||
#[cfg(feature = "full")]
|
||||
pub mod aliases {
|
||||
|
|
|
@ -191,13 +191,13 @@ impl Display for DbUrl {
|
|||
}
|
||||
|
||||
// the project doesn't compile with From
|
||||
#[allow(clippy::from_over_into)]
|
||||
#[expect(clippy::from_over_into)]
|
||||
impl Into<DbUrl> for Url {
|
||||
fn into(self) -> DbUrl {
|
||||
DbUrl(Box::new(self))
|
||||
}
|
||||
}
|
||||
#[allow(clippy::from_over_into)]
|
||||
#[expect(clippy::from_over_into)]
|
||||
impl Into<Url> for DbUrl {
|
||||
fn into(self) -> Url {
|
||||
*self.0
|
||||
|
|
|
@ -595,7 +595,6 @@ impl<RF, LF> Queries<RF, LF> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -259,8 +259,8 @@ impl CommentReportQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -422,8 +422,8 @@ impl<'a> CommentQuery<'a> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -284,8 +284,8 @@ impl PostReportQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -739,7 +739,7 @@ impl<'a> PostQuery<'a> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
post_view::{PaginationCursorData, PostQuery, PostView},
|
||||
|
|
|
@ -111,8 +111,8 @@ impl PrivateMessageReportQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::private_message_report_view::PrivateMessageReportQuery;
|
||||
|
|
|
@ -173,8 +173,8 @@ impl PrivateMessageQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{private_message_view::PrivateMessageQuery, structs::PrivateMessageView};
|
||||
|
|
|
@ -135,8 +135,7 @@ impl RegistrationApplicationQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::registration_application_view::{
|
||||
|
|
|
@ -83,8 +83,7 @@ impl VoteView {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::structs::VoteView;
|
||||
|
|
|
@ -303,7 +303,6 @@ impl CommentReplyQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{comment_reply_view::CommentReplyQuery, structs::CommentReplyView};
|
||||
|
|
|
@ -248,8 +248,7 @@ impl<'a> CommunityQuery<'a> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use crate::{community_view::CommunityQuery, structs::CommunityView};
|
||||
|
|
|
@ -303,7 +303,6 @@ impl PersonMentionQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{person_mention_view::PersonMentionQuery, structs::PersonMentionView};
|
||||
|
|
|
@ -164,7 +164,7 @@ impl PersonQuery {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -222,8 +222,8 @@ impl<T: DataSource> CommunityInboxCollector<T> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use lemmy_db_schema::{
|
||||
|
|
|
@ -192,8 +192,8 @@ impl SendManager {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod test {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -439,8 +439,8 @@ impl InstanceWorker {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod test {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -221,8 +221,6 @@ fn parse_ip(addr: &str) -> Option<IpAddr> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -136,7 +136,6 @@ impl<K: Eq + Hash, C: MapLevel> MapLevel for Map<K, C> {
|
|||
.entry(addr_part)
|
||||
.or_insert(RateLimitedGroup::new(now, adjusted_configs));
|
||||
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
let total_passes = group.check_total(action_type, now, adjusted_configs[action_type]);
|
||||
|
||||
let children_pass = group.children.check(
|
||||
|
@ -161,7 +160,6 @@ impl<K: Eq + Hash, C: MapLevel> MapLevel for Map<K, C> {
|
|||
// Evaluated if `some_children_remaining` is false
|
||||
let total_has_refill_in_future = || {
|
||||
group.total.into_iter().any(|(action_type, bucket)| {
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
let config = configs[action_type];
|
||||
bucket.update(now, config).tokens != config.capacity
|
||||
})
|
||||
|
@ -214,7 +212,6 @@ impl<C: Default> RateLimitedGroup<C> {
|
|||
now: InstantSecs,
|
||||
config: BucketConfig,
|
||||
) -> bool {
|
||||
#[allow(clippy::indexing_slicing)] // `EnumMap` has no `get` function
|
||||
let bucket = &mut self.total[action_type];
|
||||
|
||||
let new_bucket = bucket.update(now, config);
|
||||
|
@ -311,8 +308,7 @@ fn split_ipv6(ip: Ipv6Addr) -> ([u8; 6], u8, u8) {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use super::{ActionType, BucketConfig, InstantSecs, RateLimitState, RateLimitedGroup};
|
||||
|
@ -361,7 +357,6 @@ mod tests {
|
|||
assert!(post_passed);
|
||||
}
|
||||
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
let expected_buckets = |factor: u32, tokens_consumed: u32| {
|
||||
let adjusted_configs = bucket_configs.map(|_, config| BucketConfig {
|
||||
capacity: config.capacity.saturating_mul(factor),
|
||||
|
|
|
@ -107,8 +107,7 @@ pub fn markdown_check_for_blocked_urls(text: &str, blocklist: &RegexSet) -> Lemm
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -134,8 +134,6 @@ pub fn add(markdown_parser: &mut MarkdownIt) {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::utils::markdown::spoiler_rule::add;
|
||||
|
|
|
@ -34,8 +34,7 @@ pub fn scrape_text_for_mentions(text: &str) -> Vec<MentionData> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::indexing_slicing)]
|
||||
mod test {
|
||||
|
||||
use crate::utils::mention::scrape_text_for_mentions;
|
||||
|
|
|
@ -61,8 +61,7 @@ pub(crate) fn slurs_vec_to_str(slurs: &[&str]) -> String {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod test {
|
||||
|
||||
use crate::utils::slurs::{remove_slurs, slur_check, slurs_vec_to_str};
|
||||
|
|
|
@ -351,7 +351,6 @@ pub fn build_url_str_without_scheme(url_str: &str) -> LemmyResult<String> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -605,7 +605,6 @@ async fn build_update_instance_form(
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
mod tests {
|
||||
|
||||
use crate::scheduled_tasks::build_update_instance_form;
|
||||
|
|
|
@ -97,8 +97,7 @@ where
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
#[allow(clippy::indexing_slicing)]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
|
Loading…
Reference in a new issue