From 360ba46660fdff1fe5cf8ce4f720bd178711c216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=B8rl=C3=BCck=20Berg?= <36937807+henrikhorluck@users.noreply.github.com> Date: Fri, 18 Aug 2023 07:16:09 +0200 Subject: [PATCH] Make ConfigPaths store as `PathBuf` - These are paths, we can just store them raw. --- fish-rust/src/env/var.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fish-rust/src/env/var.rs b/fish-rust/src/env/var.rs index af82570cd..d2bb8f913 100644 --- a/fish-rust/src/env/var.rs +++ b/fish-rust/src/env/var.rs @@ -5,6 +5,7 @@ use bitflags::bitflags; use lazy_static::lazy_static; use libc::c_int; use std::collections::HashMap; +use std::path::PathBuf; use std::sync::Arc; /// The character used to delimit path and non-path variables in exporting and in string expansion. @@ -77,11 +78,12 @@ impl Default for EnvStackSetResult { /// A struct of configuration directories, determined in main() that fish will optionally pass to /// env_init. +#[derive(Default)] pub struct ConfigPaths { - pub data: WString, // e.g., /usr/local/share - pub sysconf: WString, // e.g., /usr/local/etc - pub doc: WString, // e.g., /usr/local/share/doc/fish - pub bin: WString, // e.g., /usr/local/bin + pub data: PathBuf, // e.g., /usr/local/share + pub sysconf: PathBuf, // e.g., /usr/local/etc + pub doc: PathBuf, // e.g., /usr/local/share/doc/fish + pub bin: PathBuf, // e.g., /usr/local/bin } /// A collection of status and pipestatus.