aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/cli.rs
diff options
context:
space:
mode:
authorKirill Chibisov <wchibisovkirill@gmail.com>2019-10-06 13:47:20 +0300
committerChristian Duerr <contact@christianduerr.com>2019-10-06 12:47:20 +0200
commit24651a6144e5071f0a72d991734a9b380255156e (patch)
tree92135f2f51abb709229dd94c29e0331cec01bf42 /alacritty/src/cli.rs
parent729eef0c933831bccfeac6a355bdb410787fbe5f (diff)
downloadr-alacritty-24651a6144e5071f0a72d991734a9b380255156e.tar.gz
r-alacritty-24651a6144e5071f0a72d991734a9b380255156e.tar.bz2
r-alacritty-24651a6144e5071f0a72d991734a9b380255156e.zip
Remove automatic config generation
Fixes #2818.
Diffstat (limited to 'alacritty/src/cli.rs')
-rw-r--r--alacritty/src/cli.rs18
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);