mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
c15fdc02e5
commit
8810dd38c7
9 changed files with 18 additions and 18 deletions
|
|
@ -357,7 +357,7 @@ impl Kitty {
|
|||
|
||||
async fn encode(img: DynamicImage) -> Result<Vec<u8>> {
|
||||
fn output(raw: &[u8], format: u8, size: (u32, u32)) -> Result<Vec<u8>> {
|
||||
let b64 = general_purpose::STANDARD.encode(raw).chars().collect::<Vec<_>>();
|
||||
let b64: Vec<_> = general_purpose::STANDARD.encode(raw).chars().collect();
|
||||
|
||||
let mut it = b64.chunks(4096).peekable();
|
||||
let mut buf = Vec::with_capacity(b64.len() + it.len() * 50);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ impl KittyOld {
|
|||
|
||||
async fn encode(img: DynamicImage) -> Result<Vec<u8>> {
|
||||
fn output(raw: &[u8], format: u8, size: (u32, u32)) -> Result<Vec<u8>> {
|
||||
let b64 = general_purpose::STANDARD.encode(raw).chars().collect::<Vec<_>>();
|
||||
let b64: Vec<_> = general_purpose::STANDARD.encode(raw).chars().collect();
|
||||
|
||||
let mut it = b64.chunks(4096).peekable();
|
||||
let mut buf = Vec::with_capacity(b64.len() + it.len() * 50);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ impl Filetype {
|
|||
}
|
||||
.into(),
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ impl Icon {
|
|||
text: r.text,
|
||||
style: StyleShadow { fg: r.fg, ..Default::default() }.into(),
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ impl InputSnap {
|
|||
#[inline]
|
||||
pub(super) fn find_window(s: &str, offset: usize, limit: usize) -> Range<usize> {
|
||||
let mut width = 0;
|
||||
let v = s
|
||||
let v: Vec<_> = s
|
||||
.chars()
|
||||
.enumerate()
|
||||
.skip(offset)
|
||||
|
|
@ -80,7 +80,7 @@ impl InputSnap {
|
|||
width += c.width().unwrap_or(0);
|
||||
if width < limit { Some(i) } else { None }
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
.collect();
|
||||
|
||||
if v.is_empty() {
|
||||
return 0..0;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ impl App {
|
|||
let tasks = &mut self.cx.tasks;
|
||||
tasks.progress = opt.progress;
|
||||
|
||||
// If the tasks pane is visible, update the summaries with a complete render.
|
||||
// If the task manager is visible, update the summaries with a complete render.
|
||||
if tasks.visible {
|
||||
let new = tasks.paginate();
|
||||
if new.len() != tasks.summaries.len()
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ impl<'a> Completion<'a> {
|
|||
|
||||
impl<'a> Widget for Completion<'a> {
|
||||
fn render(self, rect: Rect, buf: &mut Buffer) {
|
||||
let items = self
|
||||
let items: Vec<_> = self
|
||||
.cx
|
||||
.completion
|
||||
.window()
|
||||
|
|
@ -37,7 +37,7 @@ impl<'a> Widget for Completion<'a> {
|
|||
|
||||
item
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
.collect();
|
||||
|
||||
let input_area = self.cx.area(&self.cx.input.position);
|
||||
let mut area = Position::sticky(input_area, Offset {
|
||||
|
|
|
|||
|
|
@ -19,18 +19,18 @@ impl Widget for Bindings<'_> {
|
|||
}
|
||||
|
||||
// On
|
||||
let col1 =
|
||||
bindings.iter().map(|c| ListItem::new(c.on()).style(THEME.help.on)).collect::<Vec<_>>();
|
||||
let col1: Vec<_> =
|
||||
bindings.iter().map(|c| ListItem::new(c.on()).style(THEME.help.on.into())).collect();
|
||||
|
||||
// Exec
|
||||
let col2 =
|
||||
bindings.iter().map(|c| ListItem::new(c.exec()).style(THEME.help.exec)).collect::<Vec<_>>();
|
||||
let col2: Vec<_> =
|
||||
bindings.iter().map(|c| ListItem::new(c.exec()).style(THEME.help.exec.into())).collect();
|
||||
|
||||
// Desc
|
||||
let col3 = bindings
|
||||
let col3: Vec<_> = bindings
|
||||
.iter()
|
||||
.map(|c| ListItem::new(c.desc.as_deref().unwrap_or("-")).style(THEME.help.desc))
|
||||
.collect::<Vec<_>>();
|
||||
.map(|c| ListItem::new(c.desc.as_deref().unwrap_or("-")).style(THEME.help.desc.into()))
|
||||
.collect();
|
||||
|
||||
let chunks = layout::Layout::horizontal([
|
||||
Constraint::Ratio(2, 10),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ impl<'a> Widget for Select<'a> {
|
|||
let select = &self.cx.select;
|
||||
let area = self.cx.area(&select.position);
|
||||
|
||||
let items = select
|
||||
let items: Vec<_> = select
|
||||
.window()
|
||||
.iter()
|
||||
.enumerate()
|
||||
|
|
@ -27,7 +27,7 @@ impl<'a> Widget for Select<'a> {
|
|||
|
||||
ListItem::new(format!(" {v}")).style(THEME.select.active)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
.collect();
|
||||
|
||||
widgets::Clear.render(area, buf);
|
||||
List::new(items)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue