From 1e1c0a5b8cbc98bf7c8ceb138fc3e29f99522496 Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Fri, 11 Oct 2024 21:55:41 -0400 Subject: [PATCH] use Option::and_then --- src/commands/dox.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commands/dox.rs b/src/commands/dox.rs index 7819b08..a78e1b0 100644 --- a/src/commands/dox.rs +++ b/src/commands/dox.rs @@ -63,8 +63,7 @@ pub async fn dox(mut ctx: Context<'_>, .title(format!("Information about {}", user.name)) .description(get_dox_output( &mut ctx, &user, member.as_ref(), show_permissions.unwrap_or(false))) - .colour(member.map(|m| m.colour(ctx.cache())) - .unwrap_or(None) + .colour(member.and_then(|m| m.colour(ctx.cache())) .unwrap_or(user.accent_colour.unwrap_or(Colour::from_rgb(255, 255, 255)))) .image(user.face());