Skip to content

Commit

Permalink
Fix issues from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
arqunis committed Jan 16, 2025
1 parent 5f9aa6d commit 5f07257
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
26 changes: 13 additions & 13 deletions src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Creates a Guild Scheduled Event.
Expand Down Expand Up @@ -1777,7 +1777,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value::<Member>(value)
from_value::<Member>(value).map_err(From::from)
}

/// Edits a message by Id.
Expand Down Expand Up @@ -1990,7 +1990,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Changes the positions of roles in a guild.
Expand Down Expand Up @@ -2023,7 +2023,7 @@ impl Http {
}
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Modifies a scheduled event.
Expand Down Expand Up @@ -2083,7 +2083,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Edits a thread channel in the [`GuildChannel`] given its Id.
Expand Down Expand Up @@ -3427,7 +3427,7 @@ impl Http {
}
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Gets the amount of users that can be pruned.
Expand Down Expand Up @@ -3482,7 +3482,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Retrieves a list of roles in a [`Guild`].
Expand All @@ -3508,7 +3508,7 @@ impl Http {
}
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Gets a scheduled event by Id.
Expand Down Expand Up @@ -3620,7 +3620,7 @@ impl Http {
}
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Retrieves a single sticker in a [`Guild`].
Expand All @@ -3647,7 +3647,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Retrieves the webhooks for the given [`Guild`]'s Id.
Expand Down Expand Up @@ -3721,7 +3721,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Gets information about a specific invite.
Expand Down Expand Up @@ -3782,7 +3782,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Gets a message by an Id, bots only.
Expand Down Expand Up @@ -4288,7 +4288,7 @@ impl Http {
}
}

from_value(value)
from_value(value).map_err(From::from)
}

/// Starts removing some members from a guild based on the last time they've been online.
Expand Down
12 changes: 2 additions & 10 deletions src/utils/content_safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct ContentSafeOptions {
///
/// This option is ignored if the username is a next-gen username, and
/// therefore does not have a discriminator.
#[deprecated = "Discriminators are deprecated on the discord side, and this doesn't reflect message rendering behaviour"]
#[cfg_attr(not(ignore_serenity_deprecated), deprecated = "Discriminators are deprecated on the discord side, and this doesn't reflect message rendering behaviour")]
pub show_discriminator: bool,
}

Expand Down Expand Up @@ -177,7 +177,7 @@ fn clean_mention(
Mention::User(id) => {
if let Some(member) = guild.members.get(&id) {
if options.get_show_discriminator() {
#[allow(deprecated)]
#[expect(deprecated)]
let name = member.distinct();
format!("@{name}").into()
} else {
Expand Down Expand Up @@ -276,14 +276,6 @@ mod tests {
content_safe(&no_member_guild, "<@!100000000000000000>", options, &[])
);

#[allow(deprecated)]
let options = options.show_discriminator(false);
assert_eq!(
format!("@{}", user.name),
content_safe(&no_member_guild, "<@100000000000000000>", &options, &[])
);

let options = options.display_as_member_from(guild.id);
assert_eq!(
format!("@{}", member.nick.as_ref().unwrap()),
content_safe(&guild, "<@100000000000000000>", options, &[])
Expand Down

0 comments on commit 5f07257

Please sign in to comment.