From e3b8e92d5909bb7fcda8f34303873a885a571938 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Fri, 14 Jun 2024 16:46:04 +0200 Subject: [PATCH] fix new rust warnings --- filetreelist/src/filetree.rs | 2 +- filetreelist/src/filetreeitems.rs | 1 - src/ui/reflow.rs | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/filetreelist/src/filetree.rs b/filetreelist/src/filetree.rs index 37d61345f6..ddd2e6e67a 100644 --- a/filetreelist/src/filetree.rs +++ b/filetreelist/src/filetree.rs @@ -2,7 +2,7 @@ use crate::{ error::Result, filetreeitems::FileTreeItems, tree_iter::TreeIterator, TreeItemInfo, }; -use std::{collections::BTreeSet, path::Path, usize}; +use std::{collections::BTreeSet, path::Path}; /// #[derive(Copy, Clone, Debug)] diff --git a/filetreelist/src/filetreeitems.rs b/filetreelist/src/filetreeitems.rs index d9c38f7a5c..e60b3e37de 100644 --- a/filetreelist/src/filetreeitems.rs +++ b/filetreelist/src/filetreeitems.rs @@ -7,7 +7,6 @@ use crate::{error::Result, treeitems_iter::TreeItemsIterator}; use std::{ collections::{BTreeSet, HashMap}, path::{Path, PathBuf}, - usize, }; /// diff --git a/src/ui/reflow.rs b/src/ui/reflow.rs index 6255de4e97..5acf53130f 100644 --- a/src/ui/reflow.rs +++ b/src/ui/reflow.rs @@ -27,8 +27,8 @@ impl<'a, 'b> WordWrapper<'a, 'b> { symbols: &'b mut dyn Iterator>, max_line_width: u16, trim: bool, - ) -> WordWrapper<'a, 'b> { - WordWrapper { + ) -> Self { + Self { symbols, max_line_width, current_line: vec![], @@ -152,8 +152,8 @@ impl<'a, 'b> LineTruncator<'a, 'b> { pub fn new( symbols: &'b mut dyn Iterator>, max_line_width: u16, - ) -> LineTruncator<'a, 'b> { - LineTruncator { + ) -> Self { + Self { symbols, max_line_width, horizontal_offset: 0,