Skip to content

Commit 91fdb3f

Browse files
committed
Fix clippy lints
1 parent cb595b6 commit 91fdb3f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

gemini/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub enum Error {
4040
SchemeNotSupported,
4141
}
4242

43-
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
43+
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq, Eq)]
4444
pub enum Status {
4545
Input(u8),
4646
Success(u8),
@@ -88,7 +88,7 @@ impl Response {
8888
}
8989
}
9090
}
91-
#[derive(Default, PartialEq, Debug, Copy, Clone)]
91+
#[derive(Default, PartialEq, Eq, Debug, Copy, Clone)]
9292
pub struct ClientOptions {
9393
redirect: bool,
9494
}

src/widgets/tab.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use log::{debug, error, info};
1717
use once_cell::sync::Lazy;
1818
use std::cell::{Cell, RefCell};
1919
use std::collections::HashMap;
20+
use std::fmt::Write;
2021
use std::marker::PhantomData;
2122
use std::pin::Pin;
2223
use std::rc::Rc;
@@ -408,10 +409,10 @@ impl Tab {
408409
let imp = self.imp();
409410
let i = imp.current_hi.get().unwrap();
410411

411-
imp.history.borrow_mut().get(i).map(|h| {
412+
if let Some(h) = imp.history.borrow_mut().get(i) {
412413
h.cache.replace(None);
413414
self.spawn_request(self.open_history(h.clone()));
414-
});
415+
}
415416
}
416417
pub fn display_error(&self, error: anyhow::Error) {
417418
let imp = self.imp();
@@ -501,11 +502,13 @@ impl Tab {
501502
match url.scheme() {
502503
"about" => {
503504
let mut about = common::ABOUT_PAGE.to_owned();
504-
about.push_str(&format!(
505+
write!(
506+
&mut about,
505507
"\n\n## Metadata\n\nApp ID: {}\nVersion: {}",
506508
crate::config::APP_ID,
507509
crate::config::VERSION
508-
));
510+
)
511+
.unwrap();
509512
let reader = futures::io::BufReader::new(about.as_bytes());
510513
self.display_gemini(reader).await?;
511514
Ok(None)

0 commit comments

Comments
 (0)