From 14663e46b9be8bbb86e36541b8cfb9c5efc341c2 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Wed, 26 Aug 2020 00:11:51 +0300 Subject: [PATCH] Remove some old TODO comments --- melib/src/backends/maildir/backend.rs | 1 - melib/src/email.rs | 7 ------- melib/src/email/compose.rs | 1 - melib/src/email/parser.rs | 11 ----------- melib/src/text_processing/wcwidth.rs | 1 - src/components/mail/compose.rs | 7 +++++-- src/components/mail/listing/compact.rs | 1 - src/components/mail/listing/conversations.rs | 1 - src/components/mail/listing/plain.rs | 1 - src/components/mail/listing/thread.rs | 2 -- src/components/mail/view.rs | 1 - src/components/mail/view/envelope.rs | 1 - src/components/mail/view/html.rs | 3 --- src/components/mail/view/thread.rs | 1 - src/components/notifications.rs | 2 -- src/components/utilities.rs | 3 --- src/components/utilities/layouts.rs | 1 - src/components/utilities/widgets.rs | 1 - src/plugins/backend.rs | 1 - 19 files changed, 5 insertions(+), 42 deletions(-) diff --git a/melib/src/backends/maildir/backend.rs b/melib/src/backends/maildir/backend.rs index 88986bb6..1ff8a12c 100644 --- a/melib/src/backends/maildir/backend.rs +++ b/melib/src/backends/maildir/backend.rs @@ -452,7 +452,6 @@ impl MailBackend for MaildirType { if let Some((k, v)) = index_lock.iter_mut().find(|(_, v)| *v.buf == pathbuf) { - //TODO FIXME This doesn't make sense? *v = pathbuf.clone().into(); *k } else { diff --git a/melib/src/email.rs b/melib/src/email.rs index 00ae9bc9..f2b9c739 100644 --- a/melib/src/email.rs +++ b/melib/src/email.rs @@ -105,13 +105,6 @@ impl EnvelopeWrapper { }) } - pub fn update(&mut self, new_buffer: Vec) { - // TODO: Propagate error. - if let Ok(e) = EnvelopeWrapper::new(new_buffer) { - *self = e; - } - } - pub fn envelope(&self) -> &Envelope { &self.envelope } diff --git a/melib/src/email/compose.rs b/melib/src/email/compose.rs index 0d0ca99e..a664e6b1 100644 --- a/melib/src/email/compose.rs +++ b/melib/src/email/compose.rs @@ -90,7 +90,6 @@ impl str::FromStr for Draft { impl Draft { pub fn edit(envelope: &Envelope, bytes: &[u8]) -> Result { let mut ret = Draft::default(); - //TODO: Inform user if error for (k, v) in envelope.headers(&bytes).unwrap_or_else(|_| Vec::new()) { ret.headers.insert(k.try_into()?, v.into()); } diff --git a/melib/src/email/parser.rs b/melib/src/email/parser.rs index a5862c93..7af3dd1b 100644 --- a/melib/src/email/parser.rs +++ b/melib/src/email/parser.rs @@ -1133,22 +1133,11 @@ pub mod encodings { } pub fn ascii_token(input: &[u8]) -> IResult<&[u8], Vec> { - // TODO take_until used to be take_until1, check if this works let (input, word) = alt(( terminated(take_until(" =?"), peek(preceded(tag(b" "), encoded_word))), take_while(|_| true), ))(input)?; Ok((input, word.to_vec())) - /* - do_parse!( - word: alt_complete!( - terminated!( - take_until1!(" =?"), - peek!(preceded!(tag!(b" "), call!(encoded_word))) - ) | take_while!(call!(|_| true)) - ) >> ({ word.into() }) - ) - */ } pub fn phrase( diff --git a/melib/src/text_processing/wcwidth.rs b/melib/src/text_processing/wcwidth.rs index e4b41814..7cf5ea78 100644 --- a/melib/src/text_processing/wcwidth.rs +++ b/melib/src/text_processing/wcwidth.rs @@ -27,7 +27,6 @@ * Markus Kuhn -- 2001-09-08 -- public domain */ -// TODO: Spacing widths // Update to Unicode 12 #[macro_export] diff --git a/src/components/mail/compose.rs b/src/components/mail/compose.rs index eed9afba..85b2ab45 100644 --- a/src/components/mail/compose.rs +++ b/src/components/mail/compose.rs @@ -135,9 +135,12 @@ impl ViewMode { impl fmt::Display for Composer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info if self.reply_context.is_some() { - write!(f, "reply: {:8}", &self.draft.headers()["Subject"]) + write!( + f, + "reply: {}", + (&self.draft.headers()["Subject"]).trim_at_boundary(8) + ) } else { write!(f, "composing") } diff --git a/src/components/mail/listing/compact.rs b/src/components/mail/listing/compact.rs index 58b3def3..b558c10b 100644 --- a/src/components/mail/listing/compact.rs +++ b/src/components/mail/listing/compact.rs @@ -740,7 +740,6 @@ impl ListingTrait for CompactListing { ); } - /* TODO: highlight selected entries */ self.highlight_line( grid, ( diff --git a/src/components/mail/listing/conversations.rs b/src/components/mail/listing/conversations.rs index f9faa1ef..68dd678a 100644 --- a/src/components/mail/listing/conversations.rs +++ b/src/components/mail/listing/conversations.rs @@ -679,7 +679,6 @@ impl ListingTrait for ConversationsListing { ((0, 3 * top_idx), pos_dec(self.content.size(), (1, 1))), ); - /* TODO: highlight selected entries */ self.highlight_line( grid, ( diff --git a/src/components/mail/listing/plain.rs b/src/components/mail/listing/plain.rs index 7d52325d..8ccbd3a9 100644 --- a/src/components/mail/listing/plain.rs +++ b/src/components/mail/listing/plain.rs @@ -571,7 +571,6 @@ impl ListingTrait for PlainListing { ); } - /* TODO: highlight selected entries */ self.highlight_line( grid, ( diff --git a/src/components/mail/listing/thread.rs b/src/components/mail/listing/thread.rs index 532bed75..ec1b298b 100644 --- a/src/components/mail/listing/thread.rs +++ b/src/components/mail/listing/thread.rs @@ -666,7 +666,6 @@ impl ListingTrait for ThreadListing { ); } - /* TODO: highlight selected entries */ self.highlight_line( grid, ( @@ -1135,7 +1134,6 @@ impl Component for ThreadListing { return; } { - /* TODO: Move the box drawing business in separate functions */ if get_x(upper_left) > 0 && grid[(get_x(upper_left) - 1, mid)].ch() == VERT_BOUNDARY { grid[(get_x(upper_left) - 1, mid)].set_ch(LIGHT_VERTICAL_AND_RIGHT); diff --git a/src/components/mail/view.rs b/src/components/mail/view.rs index e58b05e9..4df0da0d 100644 --- a/src/components/mail/view.rs +++ b/src/components/mail/view.rs @@ -156,7 +156,6 @@ impl Clone for MailView { impl fmt::Display for MailView { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info write!(f, "{}", MailView::DESCRIPTION) } } diff --git a/src/components/mail/view/envelope.rs b/src/components/mail/view/envelope.rs index ed3b9a14..d33e7775 100644 --- a/src/components/mail/view/envelope.rs +++ b/src/components/mail/view/envelope.rs @@ -60,7 +60,6 @@ pub struct EnvelopeView { impl fmt::Display for EnvelopeView { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info write!(f, "view mail") } } diff --git a/src/components/mail/view/html.rs b/src/components/mail/view/html.rs index 549e3270..ef361f1b 100644 --- a/src/components/mail/view/html.rs +++ b/src/components/mail/view/html.rs @@ -115,7 +115,6 @@ impl HtmlView { impl fmt::Display for HtmlView { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info write!(f, "view") } } @@ -130,8 +129,6 @@ impl Component for HtmlView { } if let UIEvent::Input(Key::Char('v')) = event { - // TODO: Optional filter that removes outgoing resource requests (images and - // scripts) let binary = query_default_app("text/html"); if let Ok(binary) = binary { let p = create_temp_file(&self.bytes, None, None, true); diff --git a/src/components/mail/view/thread.rs b/src/components/mail/view/thread.rs index b542d399..14fb040d 100644 --- a/src/components/mail/view/thread.rs +++ b/src/components/mail/view/thread.rs @@ -938,7 +938,6 @@ impl ThreadView { impl fmt::Display for ThreadView { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info write!(f, "view thread") } } diff --git a/src/components/notifications.rs b/src/components/notifications.rs index 7a61bc8a..fc53bd6a 100644 --- a/src/components/notifications.rs +++ b/src/components/notifications.rs @@ -35,7 +35,6 @@ pub struct XDGNotifications { impl fmt::Display for XDGNotifications { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info write!(f, "") } } @@ -154,7 +153,6 @@ pub struct NotificationFilter {} impl fmt::Display for NotificationFilter { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info write!(f, "") } } diff --git a/src/components/utilities.rs b/src/components/utilities.rs index 604fc6ea..fcf4d262 100644 --- a/src/components/utilities.rs +++ b/src/components/utilities.rs @@ -77,7 +77,6 @@ pub struct Pager { impl fmt::Display for Pager { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display info write!(f, "{}", Pager::DESCRIPTION) } } @@ -646,7 +645,6 @@ pub struct StatusBar { impl fmt::Display for StatusBar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display info write!(f, "status bar") } } @@ -1343,7 +1341,6 @@ impl Tabbed { impl fmt::Display for Tabbed { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display info write!(f, "tabs") } } diff --git a/src/components/utilities/layouts.rs b/src/components/utilities/layouts.rs index ce664d93..c1b256b8 100644 --- a/src/components/utilities/layouts.rs +++ b/src/components/utilities/layouts.rs @@ -33,7 +33,6 @@ pub struct HSplit { impl fmt::Display for HSplit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO display subject/info Display::fmt(&self.top, f) } } diff --git a/src/components/utilities/widgets.rs b/src/components/utilities/widgets.rs index 058eca75..2fbb963f 100644 --- a/src/components/utilities/widgets.rs +++ b/src/components/utilities/widgets.rs @@ -235,7 +235,6 @@ impl Component for Field { } } UIEvent::InsertInput(Key::Ctrl('w')) => { - // FIXME: Use Unicode word-breaking algorithm. /* Cut previous word */ if let Text(ref mut s, _) = self { while s.as_str()[..s.cursor_pos()] diff --git a/src/plugins/backend.rs b/src/plugins/backend.rs index 1d18e423..87f566d3 100644 --- a/src/plugins/backend.rs +++ b/src/plugins/backend.rs @@ -29,7 +29,6 @@ use std::collections::BTreeMap; use std::collections::HashMap; use std::sync::{Arc, Mutex, RwLock}; -// TODO replace with melib::Envelope after simplifying melib::Envelope's // fields/interface/deserializing #[derive(Debug, Clone, Serialize, Deserialize)] struct SimpleEnvelope {