fix warnings and lints
parent
de81fd1a68
commit
4582bcd5ae
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
#[macro_use]
|
||||
pub mod dbg {
|
||||
#[allow(clippy::redundant_closure)]
|
||||
#[macro_export]
|
||||
macro_rules! debug {
|
||||
($val:literal) => {
|
||||
|
|
|
@ -821,6 +821,7 @@ mod tests {
|
|||
let mut buffer: Vec<u8> = Vec::new();
|
||||
//FIXME: add file
|
||||
return;
|
||||
/*
|
||||
let _ = std::fs::File::open("").unwrap().read_to_end(&mut buffer);
|
||||
let boundary = b"b1_4382d284f0c601a737bb32aaeda53160";
|
||||
let (_, body) = match mail(&buffer).to_full_result() {
|
||||
|
@ -834,6 +835,7 @@ mod tests {
|
|||
.map(|v| std::str::from_utf8(v).unwrap())
|
||||
.collect();
|
||||
println!("attachments {:?}", v);
|
||||
*/
|
||||
}
|
||||
#[test]
|
||||
fn test_addresses() {
|
||||
|
|
|
@ -9,7 +9,7 @@ xdg = "2.1.0" # >:c
|
|||
serde = "1.0.71"
|
||||
serde_derive = "1.0.71"
|
||||
serde_json = "1.0"
|
||||
config = "0.6"
|
||||
config = { path = "../../config-rs", version = "*" }
|
||||
chan = "0.1.21"
|
||||
chan-signal = "0.3.1"
|
||||
fnv = "1.0.3" # >:c
|
||||
|
|
|
@ -104,9 +104,10 @@ impl Component for Listing {
|
|||
let bottom_right = bottom_right!(area);
|
||||
let total_cols = get_x(bottom_right) - get_x(upper_left);
|
||||
|
||||
let right_component_width = match self.menu_visibility {
|
||||
true => (self.ratio * total_cols) / 100,
|
||||
false => total_cols,
|
||||
let right_component_width = if self.menu_visibility {
|
||||
(self.ratio * total_cols) / 100
|
||||
} else {
|
||||
total_cols
|
||||
};
|
||||
let mid = get_x(bottom_right) - right_component_width;
|
||||
if self.dirty && mid != get_x(upper_left) {
|
||||
|
@ -568,7 +569,7 @@ impl Listing {
|
|||
(Color::Default, Color::Default)
|
||||
};
|
||||
|
||||
let (x, _) = write_string_to_grid(
|
||||
write_string_to_grid(
|
||||
&s,
|
||||
grid,
|
||||
color_fg,
|
||||
|
|
|
@ -92,7 +92,7 @@ column_str!(struct SubjectString(String));
|
|||
|
||||
impl fmt::Display for MailboxView {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "")
|
||||
write!(f, "{}", MailboxView::DESCRIPTION)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,11 +237,9 @@ impl MailboxView {
|
|||
self.order.insert(i, idx);
|
||||
}
|
||||
let widths: (usize, usize, usize);
|
||||
let column_sep: usize;
|
||||
|
||||
if MAX_COLS >= min_width.0 + min_width.1 + min_width.2 {
|
||||
let column_sep: usize = if MAX_COLS >= min_width.0 + min_width.1 + min_width.2 {
|
||||
widths = min_width;
|
||||
column_sep = 2;
|
||||
2
|
||||
} else {
|
||||
let width = MAX_COLS - 3 - min_width.0;
|
||||
widths = (
|
||||
|
@ -249,8 +247,8 @@ impl MailboxView {
|
|||
cmp::min(min_width.1, width / 3),
|
||||
cmp::min(min_width.2, width / 3),
|
||||
);
|
||||
column_sep = 1;
|
||||
}
|
||||
1
|
||||
};
|
||||
|
||||
for ((idx, root_idx), strings) in threads.root_iter().enumerate().zip(rows) {
|
||||
let thread_node = &threads.thread_nodes()[root_idx];
|
||||
|
@ -738,8 +736,10 @@ impl ListingTrait for CompactListing {
|
|||
(self.cursor, self.views[self.cursor].cursor_pos.1, None)
|
||||
}
|
||||
fn set_coordinates(&mut self, coordinates: (usize, usize, Option<EnvelopeHash>)) {
|
||||
self.views[self.cursor].new_cursor_pos = (coordinates.0, coordinates.1, 0);
|
||||
self.views[self.cursor].unfocused = false;
|
||||
self.views
|
||||
.get_mut(self.cursor)
|
||||
.map(|v| v.new_cursor_pos = (coordinates.0, coordinates.1, 0));
|
||||
self.views.get_mut(self.cursor).map(|v| v.unfocused = false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -184,9 +184,7 @@ impl ThreadListing {
|
|||
i,
|
||||
threads,
|
||||
&indentations,
|
||||
self.length,
|
||||
has_sibling,
|
||||
// context.accounts[self.cursor_pos.0].backend.operation(envelope.hash())
|
||||
),
|
||||
&mut self.content,
|
||||
fg_color,
|
||||
|
@ -194,6 +192,7 @@ impl ThreadListing {
|
|||
((0, idx), (MAX_COLS - 1, idx)),
|
||||
false,
|
||||
);
|
||||
|
||||
for x in x..MAX_COLS {
|
||||
self.content[(x, idx)].set_ch(' ');
|
||||
self.content[(x, idx)].set_bg(bg_color);
|
||||
|
@ -205,7 +204,7 @@ impl ThreadListing {
|
|||
|
||||
match iter.peek() {
|
||||
Some((x, _, _)) if *x > indentation => {
|
||||
if debug!(has_sibling) {
|
||||
if has_sibling {
|
||||
indentations.push(true);
|
||||
} else {
|
||||
indentations.push(false);
|
||||
|
@ -366,7 +365,6 @@ impl ThreadListing {
|
|||
node_idx: usize,
|
||||
threads: &Threads,
|
||||
indentations: &[bool],
|
||||
idx_width: usize,
|
||||
has_sibling: bool,
|
||||
//op: Box<BackendOp>,
|
||||
) -> String {
|
||||
|
|
|
@ -70,36 +70,31 @@ impl HtmlView {
|
|||
));
|
||||
display_text
|
||||
}
|
||||
} else {
|
||||
if let Ok(mut html_filter) = Command::new("w3m")
|
||||
.args(&["-I", "utf-8", "-T", "text/html"])
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
{
|
||||
html_filter
|
||||
.stdin
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.write_all(&bytes)
|
||||
.expect("Failed to write to html filter stdin");
|
||||
let mut display_text = String::from(
|
||||
"Text piped through `w3m`. Press `v` to open in web browser. \n\n",
|
||||
);
|
||||
display_text.push_str(&String::from_utf8_lossy(
|
||||
&html_filter.wait_with_output().unwrap().stdout,
|
||||
));
|
||||
} else if let Ok(mut html_filter) = Command::new("w3m")
|
||||
.args(&["-I", "utf-8", "-T", "text/html"])
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
{
|
||||
html_filter
|
||||
.stdin
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.write_all(&bytes)
|
||||
.expect("Failed to write to html filter stdin");
|
||||
let mut display_text =
|
||||
String::from("Text piped through `w3m`. Press `v` to open in web browser. \n\n");
|
||||
display_text.push_str(&String::from_utf8_lossy(
|
||||
&html_filter.wait_with_output().unwrap().stdout,
|
||||
));
|
||||
|
||||
display_text
|
||||
} else {
|
||||
context.replies.push_back(UIEvent::Notification(
|
||||
Some(format!(
|
||||
"Failed to find any application to use as html filter"
|
||||
)),
|
||||
String::new(),
|
||||
));
|
||||
String::from_utf8_lossy(&bytes).to_string()
|
||||
}
|
||||
display_text
|
||||
} else {
|
||||
context.replies.push_back(UIEvent::Notification(
|
||||
Some("Failed to find any application to use as html filter".to_string()),
|
||||
String::new(),
|
||||
));
|
||||
String::from_utf8_lossy(&bytes).to_string()
|
||||
};
|
||||
if body.count_attachments() > 1 {
|
||||
display_text =
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
use super::*;
|
||||
use std::cmp;
|
||||
use std::ops::Index;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct ThreadEntry {
|
||||
|
@ -299,7 +298,7 @@ impl ThreadView {
|
|||
),
|
||||
false,
|
||||
);
|
||||
if let Some(len) = highlight_reply_subjects[y] {
|
||||
if let Some(_len) = highlight_reply_subjects[y] {
|
||||
let index = e.index.0 * 4 + 1;
|
||||
let area = ((index, 2 * y), (width - 2, 2 * y));
|
||||
let fg_color = Color::Byte(33);
|
||||
|
@ -395,12 +394,11 @@ impl ThreadView {
|
|||
.iter()
|
||||
.flat_map(|ref v| v.iter())
|
||||
.collect();
|
||||
if (rows >= visibles.len()) {
|
||||
if rows >= visibles.len() {
|
||||
upper_left = pos_dec(upper_left!(area), (1, 0));
|
||||
}
|
||||
|
||||
let mut visible_entry_counter = 0;
|
||||
for v in visibles.iter().skip(top_idx).take(rows) {
|
||||
for (visible_entry_counter, v) in visibles.iter().skip(top_idx).take(rows).enumerate() {
|
||||
if visible_entry_counter >= rows {
|
||||
break;
|
||||
}
|
||||
|
@ -417,7 +415,6 @@ impl ThreadView {
|
|||
(width - 1, 2 * idx + 1),
|
||||
),
|
||||
);
|
||||
visible_entry_counter += 1;
|
||||
}
|
||||
/* If cursor position has changed, remove the highlight from the previous position and
|
||||
* apply it in the new one. */
|
||||
|
@ -449,7 +446,7 @@ impl ThreadView {
|
|||
);
|
||||
|
||||
self.highlight_line(grid, dest_area, src_area, idx);
|
||||
if (rows < visibles.len()) {
|
||||
if rows < visibles.len() {
|
||||
ScrollBar::draw(
|
||||
grid,
|
||||
(
|
||||
|
@ -473,7 +470,7 @@ impl ThreadView {
|
|||
.iter()
|
||||
.flat_map(|ref v| v.iter())
|
||||
.collect();
|
||||
if (rows >= visibles.len()) {
|
||||
if rows >= visibles.len() {
|
||||
upper_left = pos_dec(upper_left!(area), (1, 0));
|
||||
}
|
||||
for &idx in &[old_cursor_pos, self.cursor_pos] {
|
||||
|
@ -501,7 +498,7 @@ impl ThreadView {
|
|||
);
|
||||
|
||||
self.highlight_line(grid, dest_area, src_area, entry_idx);
|
||||
if (rows < visibles.len()) {
|
||||
if rows < visibles.len() {
|
||||
ScrollBar::draw(
|
||||
grid,
|
||||
(
|
||||
|
@ -534,45 +531,41 @@ impl ThreadView {
|
|||
|
||||
/* First draw the thread subject on the first row */
|
||||
let y = if self.dirty {
|
||||
let y = {
|
||||
let mailbox = &mut context.accounts[self.coordinates.0][self.coordinates.1]
|
||||
.as_ref()
|
||||
.unwrap();
|
||||
let threads = &mailbox.collection.threads;
|
||||
let thread_node = &threads.thread_nodes()[threads.root_set(self.coordinates.2)];
|
||||
let i = if let Some(i) = thread_node.message() {
|
||||
i
|
||||
} else {
|
||||
threads.thread_nodes()[thread_node.children()[0]]
|
||||
.message()
|
||||
.unwrap()
|
||||
};
|
||||
let envelope: &Envelope = &mailbox.collection[&i];
|
||||
|
||||
let (x, y) = write_string_to_grid(
|
||||
&envelope.subject(),
|
||||
grid,
|
||||
Color::Byte(33),
|
||||
Color::Default,
|
||||
area,
|
||||
true,
|
||||
);
|
||||
for x in x..=get_x(bottom_right) {
|
||||
grid[(x, y)].set_ch(' ');
|
||||
grid[(x, y)].set_bg(Color::Default);
|
||||
grid[(x, y)].set_fg(Color::Default);
|
||||
}
|
||||
context
|
||||
.dirty_areas
|
||||
.push_back((upper_left, set_y(bottom_right, y + 1)));
|
||||
context
|
||||
.dirty_areas
|
||||
.push_back(((mid, y + 1), set_x(bottom_right, mid)));
|
||||
clear_area(grid, ((mid, y + 1), set_x(bottom_right, mid)));
|
||||
y + 2
|
||||
let mailbox = &mut context.accounts[self.coordinates.0][self.coordinates.1]
|
||||
.as_ref()
|
||||
.unwrap();
|
||||
let threads = &mailbox.collection.threads;
|
||||
let thread_node = &threads.thread_nodes()[threads.root_set(self.coordinates.2)];
|
||||
let i = if let Some(i) = thread_node.message() {
|
||||
i
|
||||
} else {
|
||||
threads.thread_nodes()[thread_node.children()[0]]
|
||||
.message()
|
||||
.unwrap()
|
||||
};
|
||||
//clear_area(grid, (set_y(upper_left, y), set_x(bottom_right, mid)));
|
||||
y
|
||||
let envelope: &Envelope = &mailbox.collection[&i];
|
||||
|
||||
let (x, y) = write_string_to_grid(
|
||||
&envelope.subject(),
|
||||
grid,
|
||||
Color::Byte(33),
|
||||
Color::Default,
|
||||
area,
|
||||
true,
|
||||
);
|
||||
for x in x..=get_x(bottom_right) {
|
||||
grid[(x, y)].set_ch(' ');
|
||||
grid[(x, y)].set_bg(Color::Default);
|
||||
grid[(x, y)].set_fg(Color::Default);
|
||||
}
|
||||
context
|
||||
.dirty_areas
|
||||
.push_back((upper_left, set_y(bottom_right, y + 1)));
|
||||
context
|
||||
.dirty_areas
|
||||
.push_back(((mid, y + 1), set_x(bottom_right, mid)));
|
||||
clear_area(grid, ((mid, y + 1), set_x(bottom_right, mid)));
|
||||
y + 2
|
||||
} else {
|
||||
get_y(upper_left) + 2
|
||||
};
|
||||
|
@ -716,9 +709,6 @@ impl ThreadView {
|
|||
}
|
||||
}
|
||||
|
||||
fn visible_entries(&self) -> Vec<Vec<usize>> {
|
||||
self.visible_entries.clone()
|
||||
}
|
||||
fn recalc_visible_entries(&mut self) {
|
||||
if self
|
||||
.entries
|
||||
|
|
|
@ -45,7 +45,7 @@ impl Component for XDGNotifications {
|
|||
notify_Notification::new()
|
||||
.appname("meli")
|
||||
.icon("mail-message-new")
|
||||
.summary(title.as_ref().map(|v| v.as_str()).unwrap_or("Event"))
|
||||
.summary(title.as_ref().map(String::as_str).unwrap_or("Event"))
|
||||
.body(&escape_str(body))
|
||||
.icon("dialog-information")
|
||||
.show()
|
||||
|
@ -124,7 +124,7 @@ impl Component for NotificationFilter {
|
|||
if let UIEvent::Notification(ref title, ref body) = event {
|
||||
if let Some(ref bin) = context.runtime_settings.notifications.script {
|
||||
if let Err(v) = Command::new(bin)
|
||||
.arg(title.as_ref().map(|v| v.as_str()).unwrap_or("Event"))
|
||||
.arg(title.as_ref().map(String::as_str).unwrap_or("Event"))
|
||||
.arg(body)
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
|
|
|
@ -187,7 +187,7 @@ impl Component for VSplit {
|
|||
if get_y(upper_left) > 1 {
|
||||
let c = grid
|
||||
.get(mid, get_y(upper_left) - 1)
|
||||
.map(|a| a.ch())
|
||||
.map(Cell::ch)
|
||||
.unwrap_or_else(|| ' ');
|
||||
if let HORZ_BOUNDARY = c {
|
||||
grid[(mid, get_y(upper_left) - 1)].set_ch(LIGHT_DOWN_AND_HORIZONTAL);
|
||||
|
@ -203,7 +203,7 @@ impl Component for VSplit {
|
|||
if get_y(bottom_right) > 1 {
|
||||
let c = grid
|
||||
.get(mid, get_y(bottom_right) - 1)
|
||||
.map(|a| a.ch())
|
||||
.map(Cell::ch)
|
||||
.unwrap_or_else(|| ' ');
|
||||
if let HORZ_BOUNDARY = c {
|
||||
grid[(mid, get_y(bottom_right) + 1)].set_ch(LIGHT_UP_AND_HORIZONTAL);
|
||||
|
@ -475,7 +475,7 @@ impl Component for Pager {
|
|||
if self.cursor_pos + height >= self.height {
|
||||
self.cursor_pos = self.height.saturating_sub(height);
|
||||
};
|
||||
let pos = copy_area_with_break(
|
||||
copy_area_with_break(
|
||||
grid,
|
||||
&self.content,
|
||||
area,
|
||||
|
@ -872,7 +872,6 @@ impl Tabbed {
|
|||
}
|
||||
fn draw_tabs(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) {
|
||||
let upper_left = upper_left!(area);
|
||||
let bottom_right = bottom_right!(area);
|
||||
|
||||
if self.children.is_empty() {
|
||||
clear_area(grid, area);
|
||||
|
|
|
@ -645,7 +645,7 @@ impl AutoComplete {
|
|||
}
|
||||
|
||||
let mut content = CellBuffer::new(
|
||||
entries.iter().map(|e| e.len()).max().unwrap_or(0) + 1,
|
||||
entries.iter().map(String::len).max().unwrap_or(0) + 1,
|
||||
entries.len(),
|
||||
Cell::with_style(Color::Byte(23), Color::Byte(7), Attr::Default),
|
||||
);
|
||||
|
|
|
@ -107,7 +107,7 @@ impl Default for FolderConf {
|
|||
|
||||
impl FolderConf {
|
||||
pub fn rename(&self) -> Option<&str> {
|
||||
self.rename.as_ref().map(|v| v.as_str())
|
||||
self.rename.as_ref().map(String::as_str)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ impl From<FileAccount> for AccountConf {
|
|||
display_name,
|
||||
};
|
||||
|
||||
let folder_confs = x.folders.clone().unwrap_or_else(|| Default::default());
|
||||
let folder_confs = x.folders.clone().unwrap_or_else(Default::default);
|
||||
|
||||
AccountConf {
|
||||
account: acc,
|
||||
|
@ -173,7 +173,7 @@ impl FileAccount {
|
|||
self.sent_folder.as_str()
|
||||
}
|
||||
pub fn html_filter(&self) -> Option<&str> {
|
||||
self.html_filter.as_ref().map(|f| f.as_str())
|
||||
self.html_filter.as_ref().map(String::as_str)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ impl FileSettings {
|
|||
.unwrap();
|
||||
|
||||
/* No point in returning without a config file. */
|
||||
match s.deserialize() {
|
||||
match s.try_into() {
|
||||
Ok(v) => Ok(v),
|
||||
Err(e) => Err(MeliError::new(e.to_string())),
|
||||
}
|
||||
|
|
|
@ -108,21 +108,20 @@ impl<'a> Iterator for MailboxIterator<'a> {
|
|||
if self.pos == self.folders.len() {
|
||||
return None;
|
||||
}
|
||||
for fh in self.folders_order[self.pos..].iter() {
|
||||
if self.pos == self.folders.len() {
|
||||
return None;
|
||||
}
|
||||
let fh = &self.folders_order[self.pos];
|
||||
|
||||
self.pos += 1;
|
||||
if self.folders[&fh].is_none() {
|
||||
return Some(None);
|
||||
}
|
||||
if let Some(Err(_)) = self.folders[&fh] {
|
||||
return Some(None);
|
||||
}
|
||||
return Some(Some(self.folders[&fh].as_ref().unwrap().as_ref().unwrap()));
|
||||
if self.pos == self.folders.len() {
|
||||
return None;
|
||||
}
|
||||
return None;
|
||||
|
||||
self.pos += 1;
|
||||
if self.folders[&fh].is_none() {
|
||||
return Some(None);
|
||||
}
|
||||
if let Some(Err(_)) = self.folders[&fh] {
|
||||
return Some(None);
|
||||
}
|
||||
return Some(Some(self.folders[&fh].as_ref().unwrap().as_ref().unwrap()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,8 +154,8 @@ impl Account {
|
|||
.or_default();
|
||||
if (f.name().eq_ignore_ascii_case("junk")
|
||||
|| f.name().eq_ignore_ascii_case("spam")
|
||||
|| f.name().eq_ignore_ascii_case("trash")
|
||||
|| f.name().eq_ignore_ascii_case("sent"))
|
||||
|| f.name().eq_ignore_ascii_case("sent")
|
||||
|| f.name().eq_ignore_ascii_case("trash"))
|
||||
&& entry.ignore.is_unset()
|
||||
{
|
||||
entry.ignore = ToggleFlag::InternalVal(true);
|
||||
|
@ -181,10 +180,6 @@ impl Account {
|
|||
|
||||
tree.push(rec(*h, &ref_folders));
|
||||
for &c in f.children() {
|
||||
let k = FolderNode {
|
||||
hash: c,
|
||||
kids: Vec::new(),
|
||||
};
|
||||
stack.push(c);
|
||||
}
|
||||
while let Some(next) = stack.pop() {
|
||||
|
@ -206,10 +201,10 @@ impl Account {
|
|||
for n in tree.iter_mut() {
|
||||
folders_order.push(n.hash);
|
||||
n.kids.sort_unstable_by_key(|f| ref_folders[&f.hash].name());
|
||||
stack.extend(n.kids.iter().rev().map(|r| Some(r)));
|
||||
stack.extend(n.kids.iter().rev().map(Some));
|
||||
while let Some(Some(next)) = stack.pop() {
|
||||
folders_order.push(next.hash);
|
||||
stack.extend(next.kids.iter().rev().map(|r| Some(r)));
|
||||
stack.extend(next.kids.iter().rev().map(Some));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -455,7 +450,7 @@ impl Account {
|
|||
pub fn save(&self, bytes: &[u8], folder: &str) -> Result<()> {
|
||||
self.backend.save(bytes, folder)
|
||||
}
|
||||
pub fn iter_mailboxes<'a>(&'a self) -> MailboxIterator<'a> {
|
||||
pub fn iter_mailboxes(&self) -> MailboxIterator {
|
||||
MailboxIterator {
|
||||
folders_order: &self.folders_order,
|
||||
folders: &self.folders,
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
Define a (x, y) point in the terminal display as a holder of a character, foreground/background
|
||||
colors and attributes.
|
||||
*/
|
||||
use super::grapheme_clusters::*;
|
||||
|
||||
use super::position::*;
|
||||
use std::convert::From;
|
||||
use std::fmt;
|
||||
|
|
|
@ -72,22 +72,22 @@ impl<'s> Iterator for WordBreakIter<'s> {
|
|||
let next_idx = graphemes[next_idx].0;
|
||||
let ret = &self.input[..next_idx];
|
||||
self.input = &self.input[next_idx..];
|
||||
return Some(ret);
|
||||
Some(ret)
|
||||
} else {
|
||||
let ret = &self.input[..self.width];
|
||||
self.input = &self.input[self.width..];
|
||||
return Some(ret);
|
||||
Some(ret)
|
||||
}
|
||||
} else {
|
||||
/* graphemes.len() < width */
|
||||
let ret = self.input;
|
||||
self.input = &self.input[0..0];
|
||||
return Some(ret);
|
||||
Some(ret)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn word_break_string(mut s: &str, width: usize) -> Vec<&str> {
|
||||
pub fn word_break_string(s: &str, width: usize) -> Vec<&str> {
|
||||
let iter = WordBreakIter { input: s, width };
|
||||
iter.collect()
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ use termion::event::Event as TermionEvent;
|
|||
use termion::event::Key as TermionKey;
|
||||
use termion::input::TermRead;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub enum Key {
|
||||
/// Backspace.
|
||||
Backspace,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use chan;
|
||||
use melib::async_workers::Work;
|
||||
use std;
|
||||
use std::mem;
|
||||
|
||||
use std::thread;
|
||||
|
||||
const MAX_WORKER: usize = 4;
|
||||
|
|
Loading…
Reference in New Issue