bhcli

A TUI for chatting on LE PHP Chats (onion)
git clone https://git.dasho.dev/n0tr1v/bhcli.git
Log | Files | Refs | README

commit 399c4ac2e50aa5486d8f62cbfb82e60e41884fda
parent 72bad403d08bea1703be59a05b3ae0686c227ec5
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 30 Mar 2023 23:24:41 -0700

cleanup

Diffstat:
Msrc/lechatphp/mod.rs | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/lechatphp/mod.rs b/src/lechatphp/mod.rs @@ -84,12 +84,9 @@ lazy_static! { } fn get_letter_img(letter: char) -> DynamicImage { - if let Some(b64_suffix) = B64_MAP.get(&letter) { - let img_dec = general_purpose::STANDARD.decode(format!("{}{}", B64_PREFIX, b64_suffix)).unwrap(); - let img = image::load_from_memory(&img_dec).unwrap(); - return img; - } - panic!("letter image not found for {}", letter); + let b64_suffix = B64_MAP.get(&letter).expect(format!("letter image not found for {}", letter).as_str()); + let img_dec = general_purpose::STANDARD.decode(format!("{}{}", B64_PREFIX, b64_suffix)).unwrap(); + image::load_from_memory(&img_dec).unwrap() } pub fn solve_b64(b64_str: &str) -> Option<String> {