mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-21 05:18:44 +00:00
refactor: change variable names
This commit is contained in:
parent
ed783859b7
commit
36f751b36e
1 changed files with 4 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ use crate::{Mutation, crypto::{hash_password, self}, error::{ServiceError}, Quer
|
|||
|
||||
use super::session_service::SessionService;
|
||||
|
||||
const CODES: [&str; 3] = ["101", "102", "103"];
|
||||
const FIELD_OF_STUDY_PREFIXES: [&str; 3] = ["101", "102", "103"];
|
||||
|
||||
pub struct CandidateService;
|
||||
|
||||
|
|
@ -70,11 +70,11 @@ impl CandidateService {
|
|||
|
||||
fn is_application_id_valid(application_id: i32) -> bool {
|
||||
let s = &application_id.to_string();
|
||||
if s.len() <= 3 { // TODO: does the code have to be exactly 6 digits?
|
||||
if s.len() <= 3 { // TODO: does the field of study prefix have to be exactly 6 digits?
|
||||
return false;
|
||||
}
|
||||
let code = &s[0..3];
|
||||
CODES.contains(&code)
|
||||
let field_of_study_prefix = &s[0..3];
|
||||
FIELD_OF_STUDY_PREFIXES.contains(&field_of_study_prefix)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue