Fixing some clippy and woodpecker lints. (#4565)

* Fixing some clippy and woodpecker lints.

* Try fixing woodpecker 1.

* Revert "Try fixing woodpecker 1."

This reverts commit 7c2020a08d7b72b179b23cf7c56c1d9fcdcb2a6e.
This commit is contained in:
Dessalines 2024-03-26 05:17:42 -04:00 committed by GitHub
parent e4356a7701
commit 95069d7648
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 121 additions and 119 deletions

View file

@ -6,21 +6,23 @@ variables:
- &install_pnpm "corepack enable pnpm" - &install_pnpm "corepack enable pnpm"
- &slow_check_paths - &slow_check_paths
- path: - path:
# rust source code include: [
- "crates/**" # rust source code
- "src/**" "crates/**",
- "**/Cargo.toml" "src/**",
- "Cargo.lock" "**/Cargo.toml",
# database migrations "Cargo.lock",
- "migrations/**" # database migrations
# typescript tests "migrations/**",
- "api_tests/**" # typescript tests
# config files and scripts used by ci "api_tests/**",
- ".woodpecker.yml" # config files and scripts used by ci
- ".rustfmt.toml" ".woodpecker.yml",
- "scripts/update_config_defaults.sh" ".rustfmt.toml",
- "diesel.toml" "scripts/update_config_defaults.sh",
- ".gitmodules" "diesel.toml",
".gitmodules",
]
# Broken for cron jobs currently, see # Broken for cron jobs currently, see
# https://github.com/woodpecker-ci/woodpecker/issues/1716 # https://github.com/woodpecker-ci/woodpecker/issues/1716
@ -198,7 +200,7 @@ steps:
- cat target/log/lemmy_*.out || true - cat target/log/lemmy_*.out || true
- "# If you can't see all output, then use the download button" - "# If you can't see all output, then use the download button"
when: when:
status: [failure] - status: [failure]
publish_release_docker: publish_release_docker:
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx
@ -211,7 +213,7 @@ steps:
- RUST_RELEASE_MODE=release - RUST_RELEASE_MODE=release
tag: ${CI_COMMIT_TAG} tag: ${CI_COMMIT_TAG}
when: when:
event: tag - event: tag
nightly_build: nightly_build:
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx
@ -224,7 +226,7 @@ steps:
- RUST_RELEASE_MODE=release - RUST_RELEASE_MODE=release
tag: dev tag: dev
when: when:
event: cron - event: cron
# using https://github.com/pksunkara/cargo-workspaces # using https://github.com/pksunkara/cargo-workspaces
publish_to_crates_io: publish_to_crates_io:
@ -237,7 +239,7 @@ steps:
- cargo workspaces publish --from-git --allow-dirty --no-verify --allow-branch "${CI_COMMIT_TAG}" --yes custom "${CI_COMMIT_TAG}" - cargo workspaces publish --from-git --allow-dirty --no-verify --allow-branch "${CI_COMMIT_TAG}" --yes custom "${CI_COMMIT_TAG}"
secrets: [cargo_api_token] secrets: [cargo_api_token]
when: when:
event: tag - event: tag
notify_on_failure: notify_on_failure:
image: alpine:3 image: alpine:3
@ -245,7 +247,7 @@ steps:
- apk add curl - apk add curl
- "curl -d'Lemmy CI build failed: ${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci" - "curl -d'Lemmy CI build failed: ${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci"
when: when:
status: [failure] - status: [failure]
notify_on_tag_deploy: notify_on_tag_deploy:
image: alpine:3 image: alpine:3
@ -253,7 +255,7 @@ steps:
- apk add curl - apk add curl
- "curl -d'lemmy:${CI_COMMIT_TAG} deployed' ntfy.sh/lemmy_drone_ci" - "curl -d'lemmy:${CI_COMMIT_TAG} deployed' ntfy.sh/lemmy_drone_ci"
when: when:
event: tag - event: tag
services: services:
database: database:

View file

@ -259,9 +259,9 @@ pub async fn local_user_view_from_jwt(
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;

View file

@ -42,8 +42,8 @@ pub async fn get_sitemap(context: Data<LemmyContext>) -> LemmyResult<HttpRespons
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
pub(crate) mod tests { pub(crate) mod tests {
#![allow(clippy::unwrap_used)]
use crate::sitemap::generate_urlset; use crate::sitemap::generate_urlset;
use chrono::{DateTime, NaiveDate, Utc}; use chrono::{DateTime, NaiveDate, Utc};

View file

@ -72,9 +72,9 @@ impl Claims {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{claims::Claims, context::LemmyContext}; use crate::{claims::Claims, context::LemmyContext};
use actix_web::test::TestRequest; use actix_web::test::TestRequest;

View file

@ -313,9 +313,9 @@ async fn is_image_content_type(client: &ClientWithMiddleware, url: &Url) -> Resu
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
context::LemmyContext, context::LemmyContext,

View file

@ -1019,9 +1019,9 @@ pub async fn proxy_image_link_opt_apub(
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -189,9 +189,9 @@ fn validate_create_payload(local_site: &LocalSite, create_site: &CreateSite) ->
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::site::create::validate_create_payload; use crate::site::create::validate_create_payload;
use lemmy_api_common::site::CreateSite; use lemmy_api_common::site::CreateSite;

View file

@ -41,9 +41,9 @@ pub fn application_question_check(
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::site::{application_question_check, site_default_post_listing_type_check}; use crate::site::{application_question_check, site_default_post_listing_type_check};
use lemmy_db_schema::{ListingType, RegistrationMode}; use lemmy_db_schema::{ListingType, RegistrationMode};

View file

@ -231,9 +231,9 @@ fn validate_update_payload(local_site: &LocalSite, edit_site: &EditSite) -> Lemm
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::site::update::validate_update_payload; use crate::site::update::validate_update_payload;
use lemmy_api_common::site::EditSite; use lemmy_api_common::site::EditSite;

View file

@ -123,8 +123,8 @@ impl InCommunity for AnnouncableActivities {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
activity_lists::{GroupInboxActivities, PersonInboxActivities, SharedInboxActivities}, activity_lists::{GroupInboxActivities, PersonInboxActivities, SharedInboxActivities},

View file

@ -319,8 +319,8 @@ pub async fn import_settings(
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::indexing_slicing)]
use crate::api::user_settings_backup::{export_settings, import_settings}; use crate::api::user_settings_backup::{export_settings, import_settings};
use activitypub_federation::config::Data; use activitypub_federation::config::Data;

View file

@ -101,8 +101,8 @@ impl Collection for ApubCommunityModerators {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use crate::{ use crate::{

View file

@ -115,9 +115,9 @@ pub(crate) async fn get_apub_community_featured(
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
pub(crate) mod tests { pub(crate) mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use crate::protocol::objects::{group::Group, tombstone::Tombstone}; use crate::protocol::objects::{group::Group, tombstone::Tombstone};

View file

@ -33,9 +33,9 @@ impl CommentAggregates {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
aggregates::comment_aggregates::CommentAggregates, aggregates::comment_aggregates::CommentAggregates,

View file

@ -31,9 +31,9 @@ impl CommunityAggregates {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
aggregates::community_aggregates::CommunityAggregates, aggregates::community_aggregates::CommunityAggregates,

View file

@ -18,9 +18,9 @@ impl PersonAggregates {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
aggregates::person_aggregates::PersonAggregates, aggregates::person_aggregates::PersonAggregates,

View file

@ -52,9 +52,9 @@ impl PostAggregates {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
aggregates::post_aggregates::PostAggregates, aggregates::post_aggregates::PostAggregates,

View file

@ -14,9 +14,9 @@ impl SiteAggregates {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
aggregates::site_aggregates::SiteAggregates, aggregates::site_aggregates::SiteAggregates,

View file

@ -61,9 +61,9 @@ impl ReceivedActivity {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use crate::{source::activity::ActorType, utils::build_db_pool_for_tests}; use crate::{source::activity::ActorType, utils::build_db_pool_for_tests};

View file

@ -385,9 +385,9 @@ async fn convert_read_languages(
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use crate::{ use crate::{

View file

@ -48,9 +48,9 @@ impl CaptchaAnswer {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::captcha_answer::{CaptchaAnswer, CaptchaAnswerForm, CheckCaptchaAnswer}, source::captcha_answer::{CaptchaAnswer, CaptchaAnswerForm, CheckCaptchaAnswer},

View file

@ -241,9 +241,9 @@ impl Saveable for CommentSaved {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
newtypes::LanguageId, newtypes::LanguageId,

View file

@ -73,9 +73,9 @@ impl CommentReply {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -381,9 +381,9 @@ impl ApubActor for Community {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -48,9 +48,9 @@ impl FederationAllowList {
} }
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{federation_allowlist::FederationAllowList, instance::Instance}, source::{federation_allowlist::FederationAllowList, instance::Instance},

View file

@ -41,9 +41,9 @@ impl Language {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{source::language::Language, utils::build_db_pool_for_tests}; use crate::{source::language::Language, utils::build_db_pool_for_tests};
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -465,9 +465,9 @@ impl Crud for AdminPurgeComment {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -81,9 +81,9 @@ impl PasswordResetRequest {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -212,9 +212,9 @@ impl PersonFollower {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -74,9 +74,9 @@ impl PersonMention {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -362,9 +362,9 @@ impl PostHide {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -80,9 +80,9 @@ impl Reportable for PostReport {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use crate::{ use crate::{

View file

@ -74,9 +74,9 @@ impl PrivateMessage {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
source::{ source::{

View file

@ -536,9 +536,9 @@ impl<RF, LF> Queries<RF, LF> {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -258,9 +258,9 @@ impl CommentReportQuery {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
comment_report_view::{CommentReportQuery, CommentReportView}, comment_report_view::{CommentReportQuery, CommentReportView},

View file

@ -426,9 +426,9 @@ impl<'a> CommentQuery<'a> {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
comment_view::{CommentQuery, CommentSortType, CommentView, DbPool}, comment_view::{CommentQuery, CommentSortType, CommentView, DbPool},

View file

@ -283,9 +283,9 @@ impl PostReportQuery {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
post_report_view::{PostReportQuery, PostReportView}, post_report_view::{PostReportQuery, PostReportView},

View file

@ -106,9 +106,9 @@ impl PrivateMessageReportQuery {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::private_message_report_view::PrivateMessageReportQuery; use crate::private_message_report_view::PrivateMessageReportQuery;
use lemmy_db_schema::{ use lemmy_db_schema::{

View file

@ -173,9 +173,9 @@ impl PrivateMessageQuery {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{private_message_view::PrivateMessageQuery, structs::PrivateMessageView}; use crate::{private_message_view::PrivateMessageQuery, structs::PrivateMessageView};
use lemmy_db_schema::{ use lemmy_db_schema::{

View file

@ -127,9 +127,9 @@ impl RegistrationApplicationQuery {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::registration_application_view::{ use crate::registration_application_view::{
RegistrationApplicationQuery, RegistrationApplicationQuery,

View file

@ -50,9 +50,9 @@ impl VoteView {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::structs::VoteView; use crate::structs::VoteView;
use lemmy_db_schema::{ use lemmy_db_schema::{

View file

@ -250,9 +250,9 @@ impl<'a> CommunityQuery<'a> {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{community_view::CommunityQuery, structs::CommunityView}; use crate::{community_view::CommunityQuery, structs::CommunityView};
use lemmy_db_schema::{ use lemmy_db_schema::{

View file

@ -163,9 +163,9 @@ impl PersonQuery {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use diesel::NotFound; use diesel::NotFound;

View file

@ -221,9 +221,9 @@ fn parse_ip(addr: &str) -> Option<IpAddr> {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
#[test] #[test]
fn test_parse_ip() { fn test_parse_ip() {

View file

@ -306,9 +306,9 @@ fn split_ipv6(ip: Ipv6Addr) -> ([u8; 6], u8, u8) {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::{ActionType, BucketConfig, InstantSecs, RateLimitState, RateLimitedGroup}; use super::{ActionType, BucketConfig, InstantSecs, RateLimitState, RateLimitedGroup};
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -107,9 +107,9 @@ pub fn markdown_check_for_blocked_urls(text: &str, blocklist: &RegexSet) -> Lemm
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -134,9 +134,9 @@ pub fn add(markdown_parser: &mut MarkdownIt) {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::utils::markdown::spoiler_rule::add; use crate::utils::markdown::spoiler_rule::add;
use markdown_it::MarkdownIt; use markdown_it::MarkdownIt;

View file

@ -34,9 +34,9 @@ pub fn scrape_text_for_mentions(text: &str) -> Vec<MentionData> {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod test { mod test {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::utils::mention::scrape_text_for_mentions; use crate::utils::mention::scrape_text_for_mentions;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -64,9 +64,9 @@ pub(crate) fn slurs_vec_to_str(slurs: &[&str]) -> String {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod test { mod test {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::utils::slurs::{remove_slurs, slur_check, slurs_vec_to_str}; use crate::utils::slurs::{remove_slurs, slur_check, slurs_vec_to_str};
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -327,9 +327,9 @@ pub fn check_urls_are_valid(urls: &Vec<String>) -> LemmyResult<Vec<String>> {
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use crate::{ use crate::{
error::LemmyErrorType, error::LemmyErrorType,

View file

@ -517,9 +517,9 @@ async fn update_instance_software(
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use lemmy_routes::nodeinfo::NodeInfo; use lemmy_routes::nodeinfo::NodeInfo;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;

View file

@ -98,9 +98,9 @@ where
} }
#[cfg(test)] #[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests { mod tests {
#![allow(clippy::unwrap_used)]
#![allow(clippy::indexing_slicing)]
use super::*; use super::*;
use actix_web::test::TestRequest; use actix_web::test::TestRequest;