Skip to content

Commit

Permalink
remove the extra quotation marks in the returned gphrases
Browse files Browse the repository at this point in the history
  • Loading branch information
k27dong committed Mar 20, 2024
1 parent eae456c commit 4daa297
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gphrasehandler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ pub async fn get_gphrase(

let mut rng = rand::thread_rng();

// values.choose(&mut rng).unwrap().to_string()
values[2].to_string()
values.choose(&mut rng).unwrap().to_string()
}
Err(error) => {
println!("Error: {}", error);
Expand Down Expand Up @@ -116,7 +115,7 @@ pub fn load_gsheet_config() -> Config {
}

pub fn format_gphrase(phrase: String) -> Vec<u8> {
let prefix_phrase = format!("8FJ20GMV{}", phrase);
let prefix_phrase = format!("8FJ20GMV{}", phrase.trim_matches('\"').replace("\\n", "\n"));

let (cow, _, _) = GB18030.encode(&prefix_phrase);

Expand Down

0 comments on commit 4daa297

Please sign in to comment.