Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit bf9c6d4

Browse files
GitButler Integration Commit
This is an integration commit for the virtual branches that GitButler is tracking. Due to GitButler managing multiple virtual branches, you cannot switch back and forth between git branches and virtual branches easily. If you switch to another branch, GitButler will need to be reinitialized. If you commit on this branch, GitButler will throw it away. Here are the branches that are currently applied: - main (refs/gitbutler/main) branch head: ed2230b - src/main.rs - Cargo.lock - .env Your previous branch was: refs/heads/main The sha for that commit was: fe6a2f6 For more information about what we're doing here, check out our docs: https://docs.gitbutler.com/features/virtual-branches/integration-branch
1 parent fe6a2f6 commit bf9c6d4

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/main.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,16 @@ async fn main() -> Result<(), anyhow::Error> {
184184

185185
/// Handle a gateway [`Event`].
186186
async fn handle(event: Event) {
187-
let skip = match &event {
188-
Event::ChannelUpdate(c) => BOT
189-
.cache
190-
.channel(c.id)
191-
.is_some_and(|cached| cached.permission_overwrites == c.permission_overwrites),
192-
Event::RoleUpdate(r) => BOT
193-
.cache
194-
.role(r.role.id)
195-
.is_some_and(|cached| cached.permissions == r.role.permissions),
196-
_ => false,
197-
};
187+
let skip = matches!(&event, Event::ChannelUpdate(c)
188+
if BOT
189+
.cache
190+
.channel(c.id)
191+
.is_some_and(|cached| cached.permission_overwrites == c.permission_overwrites))
192+
|| matches!(&event, Event::RoleUpdate(r)
193+
if BOT
194+
.cache
195+
.role(r.role.id)
196+
.is_some_and(|cached| cached.permissions == r.role.permissions));
198197

199198
BOT.cache.update(&event);
200199

0 commit comments

Comments
 (0)