bhcli

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

commit 0c92c7416e7666969f94b825c494274ca786b7e3
parent 783482249970fc51d89fb893133f8b7b9e2c8c3d
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed, 29 Mar 2023 17:55:10 -0700

error impl

Diffstat:
Msrc/lechatphp/mod.rs | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/lechatphp/mod.rs b/src/lechatphp/mod.rs @@ -1,4 +1,5 @@ use std::collections::{HashMap, HashSet}; +use std::fmt::{Display, Formatter}; use base64::{engine::general_purpose, Engine as _}; use image::{ColorType, DynamicImage, GenericImageView, Rgba}; use lazy_static::lazy_static; @@ -95,7 +96,7 @@ pub fn solve_b64(b64_str: &str) -> Option<String> { // println!("{:?}", e); None }, - } + }; } solve_difficulty2(&img) } @@ -168,6 +169,14 @@ impl Letter { #[derive(Debug)] struct CaptchaErr(String); +impl Display for CaptchaErr { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0) + } +} + +impl std::error::Error for CaptchaErr {} + // SolveDifficulty3 solve captcha for difficulty 3 // For each pixel, verify if a match is found. If we do have a match, // verify that we have some "red" in it.