aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-11-04 00:11:51 +0000
committerGitHub <noreply@github.com>2018-11-04 00:11:51 +0000
commit0b1754e73f5238a449a07979666a544877be9042 (patch)
treec0636fcc58264217c9077ac1e2985e1f8b6b7d29 /src/config.rs
parentd2f4972703fc95e20251796665feb00c768862d4 (diff)
downloadalacritty-0b1754e73f5238a449a07979666a544877be9042.tar.gz
alacritty-0b1754e73f5238a449a07979666a544877be9042.zip
Fix clippy issues
This resolves all existing clippy issues and removes some old `allow` annotations which aren't neccesary anymore.
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs
index 5e30b65a..85859cfe 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1459,7 +1459,7 @@ impl Config {
/// 2. $XDG_CONFIG_HOME/alacritty.yml
/// 3. $HOME/.config/alacritty/alacritty.yml
/// 4. $HOME/.alacritty.yml
- #[cfg(not(windows))]
+ #[cfg(not(windows))]
pub fn installed_config<'a>() -> Option<Cow<'a, Path>> {
// Try using XDG location by default
::xdg::BaseDirectories::with_prefix("alacritty")
@@ -1489,7 +1489,7 @@ impl Config {
}
#[cfg(windows)]
- pub fn installed_config() -> Option<Cow<'static, Path>> {
+ pub fn installed_config<'a>() -> Option<Cow<'a, Path>> {
if let Some(mut path) = ::std::env::home_dir() {
path.push("alacritty");
path.set_extension("yml");
@@ -1512,7 +1512,7 @@ impl Config {
#[cfg(windows)]
pub fn write_defaults() -> io::Result<Cow<'static, Path>> {
let path = ::std::env::home_dir()
- .ok_or(io::Error::new(io::ErrorKind::NotFound, "could not find profile directory"))
+ .ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "could not find profile directory"))
.and_then(|mut p| {p.push("alacritty"); p.set_extension("yml"); Ok(p)})?;
File::create(&path)?.write_all(DEFAULT_ALACRITTY_CONFIG.as_bytes())?;
Ok(path.into())
@@ -2101,7 +2101,6 @@ mod tests {
}
}
-#[cfg_attr(feature = "cargo-clippy", allow(enum_variant_names))]
#[derive(Deserialize, Copy, Clone, Debug, Eq, PartialEq)]
pub enum Key {
Scancode(u32),