Skip to content
Merged
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
8 changes: 5 additions & 3 deletions src/bin/edit/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ pub struct DisplayablePathBuf {

impl DisplayablePathBuf {
#[allow(dead_code, reason = "only used on Windows")]
pub fn from_string(str: String) -> Self {
let value = PathBuf::from(&str);
Self { value, str: Cow::Owned(str) }
pub fn from_string(string: String) -> Self {
let str = Cow::Borrowed(string.as_str());
let str = unsafe { mem::transmute::<Cow<'_, str>, Cow<'_, str>>(str) };
let value = PathBuf::from(string);
Self { value, str }
}

pub fn from_path(value: PathBuf) -> Self {
Expand Down