nushell/crates/nu-protocol/src/config_path.rs
Peter Cunderlik 7dcc08985c
Implement PartialEq for ReturnSuccess (#3888)
This makes ReturnValue and ReturnSuccess usable in assert_eq!.
2021-08-05 14:55:41 +12:00

20 lines
495 B
Rust

use serde::{Deserialize, Serialize};
use std::path::PathBuf;
/// Specifies a path to a configuration file and its type
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum ConfigPath {
/// Path to the global configuration file
Global(PathBuf),
/// Path to a local configuration file
Local(PathBuf),
}
impl ConfigPath {
pub fn get_path(&self) -> &PathBuf {
match self {
ConfigPath::Global(p) | ConfigPath::Local(p) => p,
}
}
}