From d2758c852ee856c08a28ddd490edf2b91d19f848 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 15 Jun 2023 23:31:30 -0700 Subject: [PATCH] Improve initialization in test_user --- src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9339b35..2a4bc08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -255,10 +255,11 @@ mod tests { use crate::User; fn test_user(name: &str, discriminator: u16) -> User { - let mut user = User::default(); - user.name = name.to_owned(); - user.discriminator = discriminator; - user + User { + name: name.to_owned(), + discriminator, + ..Default::default() + } } #[test]