fix clippy

This commit is contained in:
Michael Zhang 2021-03-01 01:48:28 -06:00
parent 631fdd8b73
commit 9c3a4b8c39
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
5 changed files with 24 additions and 36 deletions

View file

@ -1,19 +1,14 @@
use std::collections::{HashMap, HashSet, VecDeque}; use std::collections::{HashSet, VecDeque};
use std::mem;
use std::pin::Pin; use std::pin::Pin;
use std::sync::Arc; use std::sync::Arc;
use std::task::{Context, Poll, Waker}; use std::task::{Context, Poll, Waker};
use anyhow::{Context as AnyhowContext, Error, Result}; use anyhow::{Context as AnyhowContext, Error, Result};
use futures::{ use futures::{
future::{self, BoxFuture, Either, Future, FutureExt, TryFutureExt}, future::{self, Either, Future, FutureExt, TryFutureExt},
stream::{BoxStream, Stream, StreamExt, TryStream}, stream::StreamExt,
}; };
use genawaiter::{ use parking_lot::RwLock;
sync::{gen, Gen},
yield_,
};
use parking_lot::{RwLock, RwLockWriteGuard};
use tokio::{ use tokio::{
io::{ io::{
self, AsyncBufReadExt, AsyncRead, AsyncWrite, AsyncWriteExt, BufReader, ReadHalf, WriteHalf, self, AsyncBufReadExt, AsyncRead, AsyncWrite, AsyncWriteExt, BufReader, ReadHalf, WriteHalf,
@ -38,7 +33,7 @@ pub type ResponseSender = mpsc::UnboundedSender<Response>;
pub type ResponseStream = mpsc::UnboundedReceiver<Response>; pub type ResponseStream = mpsc::UnboundedReceiver<Response>;
type ResultQueue = Arc<RwLock<VecDeque<HandlerResult>>>; type ResultQueue = Arc<RwLock<VecDeque<HandlerResult>>>;
pub type GreetingState = Arc<RwLock<(Option<Response>, Option<Waker>)>>; pub type GreetingState = Arc<RwLock<(Option<Response>, Option<Waker>)>>;
pub const TAG_PREFIX: &str = "panorama"; pub const TAG_PREFIX: &str = "ptag";
struct HandlerResult { struct HandlerResult {
id: usize, id: usize,

View file

@ -153,7 +153,7 @@ impl ClientAuthenticated {
reference: "".to_owned(), reference: "".to_owned(),
mailbox: "*".to_owned(), mailbox: "*".to_owned(),
}; };
let (resp, stream) = self.execute(cmd).await?; let (resp, _) = self.execute(cmd).await?;
let resp = resp.await?; let resp = resp.await?;
debug!("list response: {:?}", resp); debug!("list response: {:?}", resp);
Ok(()) Ok(())
@ -164,7 +164,7 @@ impl ClientAuthenticated {
let cmd = Command::Select { let cmd = Command::Select {
mailbox: mailbox.as_ref().to_owned(), mailbox: mailbox.as_ref().to_owned(),
}; };
let (resp, stream) = self.execute(cmd).await?; let (resp, _) = self.execute(cmd).await?;
let resp = resp.await?; let resp = resp.await?;
debug!("select response: {:?}", resp); debug!("select response: {:?}", resp);
Ok(()) Ok(())

View file

@ -3,11 +3,7 @@
use std::fmt::Debug; use std::fmt::Debug;
use std::str::FromStr; use std::str::FromStr;
use pest::{ use pest::{error::Error, iterators::Pair, Parser};
error::Error,
iterators::{Pair, Pairs},
Parser,
};
use crate::response::*; use crate::response::*;
@ -156,7 +152,7 @@ fn build_msg_att_static(pair: Pair<Rule>) -> AttributeValue {
} }
} }
fn build_envelope(pair: Pair<Rule>) -> Envelope { fn build_envelope(_pair: Pair<Rule>) -> Envelope {
// TODO: do this // TODO: do this
Envelope::default() Envelope::default()
} }

View file

@ -1,6 +1,3 @@
#[macro_use]
extern crate log;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::thread; use std::thread;

View file

@ -60,21 +60,21 @@ impl Widget for Table {
for (i, row) in self.rows.iter().enumerate() { for (i, row) in self.rows.iter().enumerate() {
// queue!(w, cursor::MoveTo(rect.x, rect.y + i as u16))?; // queue!(w, cursor::MoveTo(rect.x, rect.y + i as u16))?;
if let Some(v) = self.selected_row { // if let Some(v) = self.selected_row {
if v == i as u16 { // if v == i as u16 {
// queue!( // // queue!(
// w, // // w,
// style::SetBackgroundColor(Color::White), // // style::SetBackgroundColor(Color::White),
// style::SetForegroundColor(Color::Black) // // style::SetForegroundColor(Color::Black)
// )?; // // )?;
} else { // } else {
// queue!( // // queue!(
// w, // // w,
// style::SetForegroundColor(Color::White), // // style::SetForegroundColor(Color::White),
// style::SetBackgroundColor(Color::Black) // // style::SetBackgroundColor(Color::Black)
// )?; // // )?;
} // }
} // }
let mut s = String::with_capacity(rect.w as usize); let mut s = String::with_capacity(rect.w as usize);
for (j, cell) in row.iter().enumerate() { for (j, cell) in row.iter().enumerate() {
s += &cell; s += &cell;