Skip to content

Commit

Permalink
Merge pull request #97 from intersection-project/chore/clippy
Browse files Browse the repository at this point in the history
chore: resolve clippy lints
  • Loading branch information
thetayloredman authored Apr 15, 2024
2 parents 2c9156f + 977ec2b commit f0299e5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/commands/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn crate_version(display_name: &str, crate_name: &str) -> String {

/// See what version of Intersection and our dependencies we're running
#[poise::command(slash_command)]
#[allow(clippy::const_is_empty)]
pub async fn version(ctx: Context<'_>) -> Result<(), anyhow::Error> {
let dirty_str = if build_info::GIT_DIRTY.unwrap_or(false) {
", dirty source tree"
Expand Down
1 change: 1 addition & 0 deletions src/drql/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub trait InterpreterResolver<E> {
/// Interpret a DRQL AST, deferring to the Resolver to resolve string literals, user IDs, and role IDs.
#[async_recursion]
#[instrument(skip_all, fields(node = %node))]
#[allow(clippy::multiple_bound_locations)]
pub async fn interpret<E: Send>(
node: Expr,
resolver: &mut (impl InterpreterResolver<E> + Send),
Expand Down
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,8 @@ async fn main() -> Result<(), anyhow::Error> {
#[allow(clippy::let_underscore_must_use, let_underscore_drop)]
let _: Result<_, _> = dotenv();

let filter = tracing_subscriber::EnvFilter::builder().parse(
std::env::var("RUST_LOG").unwrap_or_else(|_| "warn,intersection=info".to_string()),
)?;
let filter = tracing_subscriber::EnvFilter::builder()
.parse(env::var("RUST_LOG").unwrap_or_else(|_| "warn,intersection=info".to_string()))?;

// Note: We do not log spans by default, as they are very verbose.
// To enable these, add the .with_span_events() call to the stdout_log layer.
Expand Down
2 changes: 1 addition & 1 deletion src/models/mention.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// A mention like <@123> or @everyone
#[derive(PartialEq, Eq, Debug, Clone, Hash)]
pub enum Mention {
/// Specifically mentioning a user: `<@ID>` or <@!ID>`
/// Specifically mentioning a user: `<@ID>` or `<@!ID>`
User(poise::serenity_prelude::UserId),
/// Mentioning in the form @everyone, @here, or `<&ID>`
Role(RoleType),
Expand Down
2 changes: 1 addition & 1 deletion src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct Resolver<'a> {
pub member: &'a serenity::Member,
/// The Context made available to the command
pub ctx: &'a serenity::Context,
/// THe channel the query was originally sent in
/// `THe` channel the query was originally sent in
pub channel: &'a serenity::GuildChannel,
}
#[async_trait]
Expand Down
1 change: 1 addition & 0 deletions src/util/wrap_string_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use anyhow::bail;

/// Join a vector of strings with a separator, wrapping every time we would overflow the provided
/// size.
#[allow(clippy::assigning_clones)]
pub fn wrap_string_vec(input: &Vec<String>, sep: &str, size: usize) -> anyhow::Result<Vec<String>> {
let mut result = Vec::new();
let mut current = String::new();
Expand Down

0 comments on commit f0299e5

Please sign in to comment.