Fix unused warnings

embed
Manos Pitsidianakis 2019-02-11 14:55:29 +02:00
parent 4be5b1a868
commit 07a51de0b6
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
7 changed files with 21 additions and 33 deletions

View File

@ -422,7 +422,6 @@ impl MaildirType {
let name = name.clone();
let root_path = root_path.clone();
let map = map.clone();
let map2 = map.clone();
let tx = tx.clone();
let cache_dir = cache_dir.clone();
let path = path.clone();
@ -540,8 +539,6 @@ impl MaildirType {
let mut result = t.join();
ret.append(&mut result);
}
let mut map = map2.lock().unwrap();
let map = map.entry(folder_hash).or_default();
Ok(ret)
};
let result = thunk();

View File

@ -6,11 +6,9 @@ use std::collections::BTreeMap;
use std::fs;
use std::io;
use std::ops::{Deref, DerefMut};
use std::result;
extern crate fnv;
use self::fnv::FnvHashMap;
use self::fnv::FnvHashSet;
/// `Mailbox` represents a folder of mail.
#[derive(Debug, Clone, Default)]
@ -51,16 +49,16 @@ impl Collection {
let date_index = BTreeMap::new();
let subject_index = None;
let cache_dir =
xdg::BaseDirectories::with_profile("meli", format!("{}_Thread", folder.hash()))
.unwrap();
/* Scrap caching for now. When a cached threads file is loaded, we must remove/rehash the
* thread nodes that shouldn't exist anymore (e.g. because their file moved from /new to
* /cur, or it was deleted).
*/
let threads = Threads::new(&mut envelopes);
/*if let Some(cached) = cache_dir.find_cache_file("threads") {
/*let cache_dir =
xdg::BaseDirectories::with_profile("meli", format!("{}_Thread", folder.hash()))
.unwrap();
if let Some(cached) = cache_dir.find_cache_file("threads") {
let reader = io::BufReader::new(fs::File::open(cached).unwrap());
let result: result::Result<Threads, _> = bincode::deserialize_from(reader);
let ret = if let Ok(mut cached_t) = result {

View File

@ -627,7 +627,7 @@ impl Threads {
let mut subject_table: FnvHashMap<Vec<u8>, (bool, usize)> =
FnvHashMap::with_capacity_and_hasher(collection.len(), Default::default());
for (i, &r) in root_set.iter().enumerate() {
for &r in root_set.iter() {
/* "Find the subject of that sub-tree": */
let (mut subject, mut is_re): (_, bool) = if self.thread_nodes[r].message.is_some() {
/* "If there is a message in the Container, the subject is the subject of that

View File

@ -1,5 +1,4 @@
use super::*;
use components::utilities::PageMovement;
pub trait IndexContent: Component {
/* Handles the drawing of one entry */
@ -16,10 +15,10 @@ pub trait IndexContent: Component {
#[derive(Debug, PartialEq)]
enum IndexState {
Uninitialized,
//Uninitialized,
Listing,
Unfocused,
Search,
//Search,
}
#[derive(Debug)]
@ -58,14 +57,6 @@ impl Component for Index {
}
match self.state {
IndexState::Uninitialized => {
self.content.refresh(context);
/* copy area */
self.state = IndexState::Listing;
self.draw(grid, area, context);
return;
}
IndexState::Listing => {
/* rehighlight entries, redraw pages */
let upper_left = upper_left!(area);
@ -125,7 +116,7 @@ impl Component for Index {
IndexState::Unfocused => {
self.content.draw(grid, area, context);
}
IndexState::Search => unreachable!(),
//IndexState::Search => unreachable!(),
}
self.dirty = false;

View File

@ -58,7 +58,8 @@ impl Default for Indexer {
}
impl Indexer {
fn draw_menu(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) {}
fn draw_menu(&mut self, _grid: &mut CellBuffer, _area: Area, _context: &mut Context) {
}
}
impl Component for Indexer {
@ -104,7 +105,7 @@ impl Component for Indexer {
}
match event.event_type {
UIEventType::RefreshMailbox(c) => {
UIEventType::RefreshMailbox(_) => {
self.dirty = true;
}
UIEventType::ChangeMode(UIMode::Normal) => {

View File

@ -530,21 +530,20 @@ impl Component for ThreadListing {
}
return;
}
{
let account = &context.accounts[self.cursor_pos.0];
let mailbox = &account[self.cursor_pos.1].as_ref().unwrap();
let coordinates = (
self.cursor_pos.0,
self.cursor_pos.1,
self.locations[self.cursor_pos.2],
let coordinates = (
self.cursor_pos.0,
self.cursor_pos.1,
self.locations[self.cursor_pos.2],
);
self.view = Some(MailView::new(coordinates, None, None));
}
self.view = Some(MailView::new(coordinates, None, None));
self.view.as_mut().unwrap().draw(
grid,
(set_y(upper_left, mid + 1), bottom_right),
context,
);
self.dirty = false;
}
}

View File

@ -193,6 +193,7 @@ impl Account {
*/
}
/*
fn add_replies_to_folder(&mut self, folder_index: usize) {
if let Some(sent_index) = self.sent_folder.as_ref() {
if self.folders[*sent_index]
@ -226,6 +227,7 @@ impl Account {
}
}
}
*/
pub fn status(&mut self, index: usize) -> result::Result<(), usize> {
match self.workers[index].as_mut() {