1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#[allow(unused_imports)] use log::{debug, error, info, trace, warn}; pub fn caste_string_to_int(caste_label: String) -> i32 { let mut caste = caste_label; caste.make_ascii_lowercase(); match caste.as_ref() { "female" => 0, "male" => 1, "default" => -1, // TODO: "worker" see r26 x => { warn!("Conversation Function: Caste could not match: {}", x); -1 } } }