exclude trivial id() functions from coverage
This commit is contained in:
parent
3040dcc46b
commit
262a52a8e9
|
@ -47,6 +47,7 @@ pub struct VoiceState {
|
|||
}
|
||||
|
||||
impl Updateable for VoiceState {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Snowflake {
|
||||
if let Some(id) = self.id {
|
||||
id // ID exists: Only the case for Spacebar Server impls
|
||||
|
|
|
@ -31,7 +31,9 @@ pub struct AutoModerationRuleUpdate {
|
|||
}
|
||||
|
||||
#[cfg(feature = "client")]
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
impl UpdateMessage<AutoModerationRule> for AutoModerationRuleUpdate {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
Some(self.rule.id)
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ impl WebSocketEvent for ChannelCreate {}
|
|||
|
||||
#[cfg(feature = "client")]
|
||||
impl UpdateMessage<Guild> for ChannelCreate {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
self.channel.guild_id
|
||||
}
|
||||
|
@ -73,6 +74,8 @@ impl UpdateMessage<Channel> for ChannelUpdate {
|
|||
let mut write = object_to_update.write().unwrap();
|
||||
*write = self.channel.clone();
|
||||
}
|
||||
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
Some(self.channel.id)
|
||||
}
|
||||
|
@ -111,6 +114,7 @@ pub struct ChannelDelete {
|
|||
|
||||
#[cfg(feature = "client")]
|
||||
impl UpdateMessage<Guild> for ChannelDelete {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
self.channel.guild_id
|
||||
}
|
||||
|
|
|
@ -30,7 +30,9 @@ pub struct GuildCreate {
|
|||
}
|
||||
|
||||
#[cfg(feature = "client")]
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
impl UpdateMessage<Guild> for GuildCreate {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
match &self.d {
|
||||
GuildCreateDataOption::UnavailableGuild(unavailable) => Some(unavailable.id),
|
||||
|
@ -92,6 +94,7 @@ impl WebSocketEvent for GuildUpdate {}
|
|||
|
||||
#[cfg(feature = "client")]
|
||||
impl UpdateMessage<Guild> for GuildUpdate {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
Some(self.guild.id)
|
||||
}
|
||||
|
@ -111,6 +114,7 @@ pub struct GuildDelete {
|
|||
|
||||
#[cfg(feature = "client")]
|
||||
impl UpdateMessage<Guild> for GuildDelete {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
Some(self.guild.id)
|
||||
}
|
||||
|
@ -225,6 +229,7 @@ impl WebSocketEvent for GuildRoleCreate {}
|
|||
|
||||
#[cfg(feature = "client")]
|
||||
impl UpdateMessage<Guild> for GuildRoleCreate {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
Some(self.guild_id)
|
||||
}
|
||||
|
@ -258,6 +263,7 @@ impl WebSocketEvent for GuildRoleUpdate {}
|
|||
|
||||
#[cfg(feature = "client")]
|
||||
impl UpdateMessage<RoleObject> for GuildRoleUpdate {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
Some(self.role.id)
|
||||
}
|
||||
|
|
|
@ -135,6 +135,7 @@ where
|
|||
fn update(&mut self, object_to_update: Shared<T>) {
|
||||
update_object(self.get_json(), object_to_update)
|
||||
}
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake>;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ impl WebSocketEvent for ThreadUpdate {}
|
|||
|
||||
#[cfg(feature = "client")]
|
||||
impl UpdateMessage<Channel> for ThreadUpdate {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn id(&self) -> Option<Snowflake> {
|
||||
Some(self.thread.id)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue