diff --git a/src/api_data/res_get_security_questions.rs b/src/api_data/res_get_security_questions.rs index 3ab5685..4452fdf 100644 --- a/src/api_data/res_get_security_questions.rs +++ b/src/api_data/res_get_security_questions.rs @@ -7,14 +7,15 @@ use crate::data::user::User; #[derive(Serialize)] pub struct ResGetSecurityQuestions { - questions: Vec + questions: Vec, } impl ResGetSecurityQuestions { pub fn new(user: &User) -> ResGetSecurityQuestions { - let mut questions = Vec::new(); - questions.push(user.security_question_1.clone().unwrap_or(String::new())); - questions.push(user.security_question_2.clone().unwrap_or(String::new())); + let questions = vec![ + user.security_question_1.clone().unwrap_or_default(), + user.security_question_2.clone().unwrap_or_default(), + ]; ResGetSecurityQuestions { questions } }