Skip to content

Commit e5040f9

Browse files
committed
Fixed clippy warnings
1 parent 3cd4990 commit e5040f9

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ pub fn run_v2(url: &str, min_id: &str, other_download: bool) -> anyhow::Result<S
3333
let k = &httpstring[(e + "rel=\"amphtml\"".len())..];
3434
let e = k.split('"').nth(1).unwrap();
3535
println!("Using AMPHTML");
36-
let k = crate::utils::http_get(e)?;
37-
k
36+
crate::utils::http_get(e)?
3837
} else {
3938
httpstring
4039
};

src/text_element/compiler/html.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ impl<'a> TextCompound<'a> {
1313
TextCompound::Raw(a) => {
1414
string.push_str("[0,\"");
1515
string.push_str(
16-
&a.replace("\n", "\\n")
17-
.replace("\r", "\\r")
18-
.replace("\t", "\\t")
19-
.replace("\"", "\\\""),
16+
&a.replace('\n', "\\n")
17+
.replace('\r', "\\r")
18+
.replace('\t', "\\t")
19+
.replace('\"', "\\\""),
2020
);
2121
string.push_str("\"]");
2222
}
@@ -35,16 +35,16 @@ impl<'a> TextCompound<'a> {
3535
}
3636
TextCompound::Underline(_) => (),
3737
TextCompound::Array(a) => {
38-
string.push_str("[");
38+
string.push('[');
3939
let mut j = false;
4040
for x in a {
4141
if j {
42-
string.push_str(",");
42+
string.push(',');
4343
}
4444
j = true;
4545
x.json(string);
4646
}
47-
string.push_str("]");
47+
string.push(']');
4848
}
4949
TextCompound::Abbr(_, _) => (),
5050
TextCompound::Sup(_) => (),

src/utils.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ pub fn get_img_link_map<'a>(
4646

4747
const TEMPLATE: &str = include_str!("../template/template.html");
4848

49+
// Justification we want to launch all image compression before joining the threads
50+
#[allow(clippy::needless_collect)]
4951
pub fn gen_html_2(parts: &[TextCompound], ctx: &mut Context) -> String {
5052
let ctx1 = ctx.clone();
5153
let mut string = String::with_capacity(50_000);

0 commit comments

Comments
 (0)