Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/commands/tui/diff.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{ffi::OsString, path::PathBuf};
use std::{borrow::Cow, ffi::OsStr, path::PathBuf};

use anyhow::Result;
use crossterm::event::{Event, KeyCode, KeyEventKind};
Expand Down Expand Up @@ -80,7 +80,7 @@ impl DiffNode {
}
}

fn name(&self) -> OsString {
fn name(&self) -> Cow<'_, OsStr> {
self.0.as_ref().reduce(|l, _| l).name()
}

Expand Down
7 changes: 2 additions & 5 deletions src/commands/tui/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,8 @@ impl TreeSummary {
let mut tree_without_meta = Tree::default();
p.inc(1);
for node in &tree.nodes {
let mut node_without_meta = Node::new_node(
node.name().as_os_str(),
node.node_type.clone(),
Metadata::default(),
);
let mut node_without_meta =
Node::new_node(&node.name(), node.node_type.clone(), Metadata::default());
node_without_meta.content = node.content.clone();
summary.update_from_node(node);
if let Some(id) = node.subtree {
Expand Down
7 changes: 1 addition & 6 deletions src/commands/webdav/webdavfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,7 @@ impl DavDirEntry for DavFsDirEntry {

#[cfg(windows)]
fn name(&self) -> Vec<u8> {
self.0
.name()
.as_os_str()
.to_string_lossy()
.to_string()
.into_bytes()
self.0.name().to_string_lossy().to_string().into_bytes()
}
}

Expand Down
Loading