Skip to content

Commit 5e53f35

Browse files
committed
ci
1 parent 7bac612 commit 5e53f35

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

ansi2/src/main.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use ansi2::{css::Mode, theme::Theme};
44
use ansi2::{html::to_html, svg::to_svg, text::to_text};
55
use base64::Engine;
66
use base64::prelude::BASE64_STANDARD;
7-
use clap::{Parser, ValueEnum, command};
7+
use clap::{Parser, ValueEnum};
88
use std::path::Path;
99
use std::{fs::read, io::Read};
1010

@@ -53,15 +53,14 @@ struct Args {
5353
}
5454

5555
fn process_input(buf: Vec<u8>) -> String {
56-
if let Some(ty) = infer::get(&buf) {
57-
if ty.matcher_type() == infer::MatcherType::Image {
58-
if let Some(s) = image_to_ans(&buf) {
59-
return s;
60-
}
61-
}
56+
if let Some(ty) = infer::get(&buf)
57+
&& ty.matcher_type() == infer::MatcherType::Image
58+
&& let Some(s) = image_to_ans(&buf)
59+
{
60+
return s;
6261
}
6362

64-
return String::from_utf8_lossy(&buf).to_string();
63+
String::from_utf8_lossy(&buf).to_string()
6564
}
6665
fn main() {
6766
let args: Args = Args::parse();
@@ -103,7 +102,7 @@ fn main() {
103102

104103
let bin = read(font_url).expect("read font file error");
105104
let base64 = BASE64_STANDARD.encode(bin);
106-
return format!("data:font;base64,{base64}");
105+
format!("data:font;base64,{base64}")
107106
});
108107

109108
let output = match format {

0 commit comments

Comments
 (0)