Skip to content

Commit

Permalink
Prevent CI clippy errors (#1384)
Browse files Browse the repository at this point in the history
For quite some time now, every CI Lint failed because of two clippy errors. This fixes it.

Details:
`src/model/misc.rs:388` - Allowing `unwrap_used` is required because `#[tokio::test]` adds an unwrap when it expands (see [entry.rs](https://docs.rs/tokio-macros/1.2.0/src/tokio_macros/entry.rs.html#329)).
` src/utils/mod.rs` - Allowing `non_ascii_literal` for `test_content_safe` does nothing, nor does allowing it for both responsible strings. Adding a block around them and declaring them inside doesn't work either. Moving the allow attribute to the upper mod (`utils::test`) works, and despite broadening the scope of allowance, it's still very limited.
  • Loading branch information
Unoqwy committed Jun 9, 2021
1 parent 073c22f commit a788fe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/model/misc.rs
Expand Up @@ -385,6 +385,7 @@ mod test {
use crate::utils::Colour;

#[tokio::test]
#[allow(clippy::unwrap_used)]
async fn test_mention() {
let channel = Channel::Guild(GuildChannel {
bitrate: None,
Expand Down
3 changes: 1 addition & 2 deletions src/utils/mod.rs
Expand Up @@ -756,7 +756,7 @@ pub async fn content_safe(
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::unwrap_used, clippy::non_ascii_literal)]
mod test {
use super::*;
#[cfg(feature = "cache")]
Expand Down Expand Up @@ -803,7 +803,6 @@ mod test {
}

#[cfg(feature = "cache")]
#[allow(clippy::non_ascii_literal)]
#[tokio::test]
async fn test_content_safe() {
use std::{collections::HashMap, sync::Arc};
Expand Down

0 comments on commit a788fe2

Please sign in to comment.