@@ -55,21 +55,24 @@ impl ChannelId {
5555 guild_id : Option < GuildId > ,
5656 ) -> Result < GuildChannel > {
5757 #[ cfg( feature = "cache" ) ]
58- if let Some ( cache) = cache_http. cache ( )
59- && let Some ( guild_id) = guild_id
60- && let Some ( guild) = cache. guild ( guild_id)
61- && let Some ( channel) = guild. channels . get ( & self )
62- {
63- return Ok ( channel. clone ( ) ) ;
64- }
65-
66- #[ cfg( feature = "temp_cache" ) ]
67- if let Some ( temp_channel) = cache. temp_channels . get ( & self ) {
68- if guild_id. is_some_and ( |id| temp_channel. base . guild_id != id) {
69- return Err ( Error :: Model ( ModelError :: ChannelNotFound ) ) ;
58+ // Ignore clippy, the two `if let`s must be separated
59+ #[ allow( clippy:: collapsible_if) ]
60+ if let Some ( cache) = cache_http. cache ( ) {
61+ if let Some ( guild_id) = guild_id
62+ && let Some ( guild) = cache. guild ( guild_id)
63+ && let Some ( channel) = guild. channels . get ( & self )
64+ {
65+ return Ok ( channel. clone ( ) ) ;
7066 }
7167
72- return Ok ( GuildChannel :: clone ( & temp_channel) ) ;
68+ #[ cfg( feature = "temp_cache" ) ]
69+ if let Some ( temp_channel) = cache. temp_channels . get ( & self ) {
70+ if guild_id. is_some_and ( |id| temp_channel. base . guild_id != id) {
71+ return Err ( Error :: Model ( ModelError :: ChannelNotFound ) ) ;
72+ }
73+
74+ return Ok ( GuildChannel :: clone ( & temp_channel) ) ;
75+ }
7376 }
7477
7578 let channel = cache_http. http ( ) . get_channel ( self . widen ( ) ) . await ?;
0 commit comments