Skip to content

Commit c3768ae

Browse files
committed
..
1 parent 1e7d781 commit c3768ae

File tree

9 files changed

+17
-21
lines changed

9 files changed

+17
-21
lines changed

yazi-adaptor/src/kitty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl Kitty {
357357

358358
async fn encode(img: DynamicImage) -> Result<Vec<u8>> {
359359
fn output(raw: &[u8], format: u8, size: (u32, u32)) -> Result<Vec<u8>> {
360-
let b64 = general_purpose::STANDARD.encode(raw).chars().collect::<Vec<_>>();
360+
let b64: Vec<_> = general_purpose::STANDARD.encode(raw).chars().collect();
361361

362362
let mut it = b64.chunks(4096).peekable();
363363
let mut buf = Vec::with_capacity(b64.len() + it.len() * 50);

yazi-adaptor/src/kitty_old.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl KittyOld {
3535

3636
async fn encode(img: DynamicImage) -> Result<Vec<u8>> {
3737
fn output(raw: &[u8], format: u8, size: (u32, u32)) -> Result<Vec<u8>> {
38-
let b64 = general_purpose::STANDARD.encode(raw).chars().collect::<Vec<_>>();
38+
let b64: Vec<_> = general_purpose::STANDARD.encode(raw).chars().collect();
3939

4040
let mut it = b64.chunks(4096).peekable();
4141
let mut buf = Vec::with_capacity(b64.len() + it.len() * 50);

yazi-config/src/theme/filetype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Filetype {
9797
}
9898
.into(),
9999
})
100-
.collect::<Vec<_>>(),
100+
.collect(),
101101
)
102102
}
103103
}

yazi-config/src/theme/icon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl Icon {
3535
text: r.text,
3636
style: StyleShadow { fg: r.fg, ..Default::default() }.into(),
3737
})
38-
.collect::<Vec<_>>(),
38+
.collect(),
3939
)
4040
}
4141
}

yazi-core/src/input/snap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ impl InputSnap {
7272
#[inline]
7373
pub(super) fn find_window(s: &str, offset: usize, limit: usize) -> Range<usize> {
7474
let mut width = 0;
75-
let v = s
75+
let v: Vec<_> = s
7676
.chars()
7777
.enumerate()
7878
.skip(offset)
7979
.map_while(|(i, c)| {
8080
width += c.width().unwrap_or(0);
8181
if width < limit { Some(i) } else { None }
8282
})
83-
.collect::<Vec<_>>();
83+
.collect();
8484

8585
if v.is_empty() {
8686
return 0..0;

yazi-fm/src/app/commands/update_progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl App {
2626
let tasks = &mut self.cx.tasks;
2727
tasks.progress = opt.progress;
2828

29-
// If the tasks pane is visible, update the summaries with a complete render.
29+
// If the task manager is visible, update the summaries with a complete render.
3030
if tasks.visible {
3131
let new = tasks.paginate();
3232
if new.len() != tasks.summaries.len()

yazi-fm/src/completion/completion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl<'a> Completion<'a> {
1515

1616
impl<'a> Widget for Completion<'a> {
1717
fn render(self, rect: Rect, buf: &mut Buffer) {
18-
let items = self
18+
let items: Vec<_> = self
1919
.cx
2020
.completion
2121
.window()
@@ -37,7 +37,7 @@ impl<'a> Widget for Completion<'a> {
3737

3838
item
3939
})
40-
.collect::<Vec<_>>();
40+
.collect();
4141

4242
let input_area = self.cx.area(&self.cx.input.position);
4343
let mut area = Position::sticky(input_area, Offset {

yazi-fm/src/help/bindings.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,18 @@ impl Widget for Bindings<'_> {
1919
}
2020

2121
// On
22-
let col1 = bindings
23-
.iter()
24-
.map(|c| ListItem::new(c.on()).style(THEME.help.on.into()))
25-
.collect::<Vec<_>>();
22+
let col1: Vec<_> =
23+
bindings.iter().map(|c| ListItem::new(c.on()).style(THEME.help.on.into())).collect();
2624

2725
// Exec
28-
let col2 = bindings
29-
.iter()
30-
.map(|c| ListItem::new(c.exec()).style(THEME.help.exec.into()))
31-
.collect::<Vec<_>>();
26+
let col2: Vec<_> =
27+
bindings.iter().map(|c| ListItem::new(c.exec()).style(THEME.help.exec.into())).collect();
3228

3329
// Desc
34-
let col3 = bindings
30+
let col3: Vec<_> = bindings
3531
.iter()
3632
.map(|c| ListItem::new(c.desc.as_deref().unwrap_or("-")).style(THEME.help.desc.into()))
37-
.collect::<Vec<_>>();
33+
.collect();
3834

3935
let chunks = layout::Layout::new(Direction::Horizontal, [
4036
Constraint::Ratio(2, 10),

yazi-fm/src/select/select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl<'a> Widget for Select<'a> {
1616
let select = &self.cx.select;
1717
let area = self.cx.area(&select.position);
1818

19-
let items = select
19+
let items: Vec<_> = select
2020
.window()
2121
.iter()
2222
.enumerate()
@@ -27,7 +27,7 @@ impl<'a> Widget for Select<'a> {
2727

2828
ListItem::new(format!(" {v}")).style(THEME.select.active.into())
2929
})
30-
.collect::<Vec<_>>();
30+
.collect();
3131

3232
widgets::Clear.render(area, buf);
3333
List::new(items)

0 commit comments

Comments
 (0)