diff options
Diffstat (limited to 'alacritty/src/cli.rs')
-rw-r--r-- | alacritty/src/cli.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index d5eb12d7..aabcdee3 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -12,9 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::borrow::Cow; use std::cmp::max; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use clap::{crate_authors, crate_description, crate_name, crate_version, App, Arg}; use log::{self, LevelFilter}; @@ -242,8 +241,8 @@ impl Options { options } - pub fn config_path(&self) -> Option<Cow<'_, Path>> { - self.config.as_ref().map(|p| Cow::Borrowed(p.as_path())) + pub fn config_path(&self) -> Option<PathBuf> { + self.config.clone() } pub fn into_config(self, mut config: Config) -> Config { @@ -284,15 +283,12 @@ impl Options { #[cfg(test)] mod test { - use alacritty_terminal::config::DEFAULT_ALACRITTY_CONFIG; - use crate::cli::Options; use crate::config::Config; #[test] fn dynamic_title_ignoring_options_by_default() { - let config: Config = - ::serde_yaml::from_str(DEFAULT_ALACRITTY_CONFIG).expect("deserialize config"); + let config = Config::default(); let old_dynamic_title = config.dynamic_title(); let config = Options::default().into_config(config); @@ -302,8 +298,7 @@ mod test { #[test] fn dynamic_title_overridden_by_options() { - let config: Config = - ::serde_yaml::from_str(DEFAULT_ALACRITTY_CONFIG).expect("deserialize config"); + let config = Config::default(); let mut options = Options::default(); options.title = Some("foo".to_owned()); @@ -314,8 +309,7 @@ mod test { #[test] fn dynamic_title_overridden_by_config() { - let mut config: Config = - ::serde_yaml::from_str(DEFAULT_ALACRITTY_CONFIG).expect("deserialize config"); + let mut config = Config::default(); config.window.title = Some("foo".to_owned()); let config = Options::default().into_config(config); |