aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-06-30 18:59:55 +0200
committera-kenji <aks.kenji@protonmail.com>2021-06-30 18:59:55 +0200
commit242e41d67f0835f26b8fa0961a50fcbbf0bb2a91 (patch)
treed7334069986b139f253ae877363e9a6d9f0071dd /zellij-utils/src/input
parentModularize spawn_terminal_function (diff)
parentMerge pull request #591 from a-kenji/update-dependencies (diff)
downloadsl0ppij-242e41d67f0835f26b8fa0961a50fcbbf0bb2a91.tar.gz
sl0ppij-242e41d67f0835f26b8fa0961a50fcbbf0bb2a91.tar.xz
sl0ppij-242e41d67f0835f26b8fa0961a50fcbbf0bb2a91.zip
Merge branch 'main' of https://github.com/zellij-org/zellij into modularize-spawn-terminal
Diffstat (limited to 'zellij-utils/src/input')
-rw-r--r--zellij-utils/src/input/actions.rs4
-rw-r--r--zellij-utils/src/input/config.rs4
-rw-r--r--zellij-utils/src/input/layout.rs8
-rw-r--r--zellij-utils/src/input/options.rs2
4 files changed, 9 insertions, 9 deletions
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs
index 4e0ce0cb..615df3c4 100644
--- a/zellij-utils/src/input/actions.rs
+++ b/zellij-utils/src/input/actions.rs
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
use zellij_tile::data::InputMode;
/// The four directions (left, right, up, down).
-#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
+#[derive(Eq, Clone, Debug, PartialEq, Deserialize, Serialize)]
pub enum Direction {
Left,
Right,
@@ -17,7 +17,7 @@ pub enum Direction {
// They might need to be adjusted in the default config
// as well `../../../assets/config/default.yaml`
/// Actions that can be bound to keys.
-#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
+#[derive(Eq, Clone, Debug, PartialEq, Deserialize, Serialize)]
pub enum Action {
/// Quit Zellij.
Quit,
diff --git a/zellij-utils/src/input/config.rs b/zellij-utils/src/input/config.rs
index 56e333f4..6a65109a 100644
--- a/zellij-utils/src/input/config.rs
+++ b/zellij-utils/src/input/config.rs
@@ -66,7 +66,7 @@ impl TryFrom<&CliArgs> for Config {
fn try_from(opts: &CliArgs) -> ConfigResult {
if let Some(ref path) = opts.config {
- return Config::new(&path);
+ return Config::new(path);
}
if let Some(Command::Setup(ref setup)) = opts.command {
@@ -96,7 +96,7 @@ impl TryFrom<&CliArgs> for Config {
impl Config {
/// Uses defaults, but lets config override them.
pub fn from_yaml(yaml_config: &str) -> ConfigResult {
- let config_from_yaml: ConfigFromYaml = serde_yaml::from_str(&yaml_config)?;
+ let config_from_yaml: ConfigFromYaml = serde_yaml::from_str(yaml_config)?;
let keybinds = Keybinds::get_default_keybinds_with_config(config_from_yaml.keybinds);
let options = Options::from_yaml(config_from_yaml.options);
let themes = config_from_yaml.themes;
diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs
index f694423a..16309db1 100644
--- a/zellij-utils/src/input/layout.rs
+++ b/zellij-utils/src/input/layout.rs
@@ -69,8 +69,8 @@ impl Layout {
layout_dir: Option<PathBuf>,
) -> Option<Layout> {
let layout_result = layout
- .map(|p| Layout::from_dir(&p, layout_dir.as_ref()))
- .or_else(|| layout_path.map(|p| Layout::new(&p)))
+ .map(|p| Layout::from_dir(p, layout_dir.as_ref()))
+ .or_else(|| layout_path.map(|p| Layout::new(p)))
.or_else(|| {
Some(Layout::from_dir(
&std::path::PathBuf::from("default"),
@@ -138,7 +138,7 @@ impl Layout {
&self,
space: &PositionAndSize,
) -> Vec<(Layout, PositionAndSize)> {
- split_space(space, &self)
+ split_space(space, self)
}
}
@@ -286,7 +286,7 @@ fn split_space(
for (i, part) in layout.parts.iter().enumerate() {
let part_position_and_size = split_parts.get(i).unwrap();
if !part.parts.is_empty() {
- let mut part_positions = split_space(&part_position_and_size, part);
+ let mut part_positions = split_space(part_position_and_size, part);
pane_positions.append(&mut part_positions);
} else {
pane_positions.push((part.clone(), *part_position_and_size));
diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs
index 88503959..4ebb5b86 100644
--- a/zellij-utils/src/input/options.rs
+++ b/zellij-utils/src/input/options.rs
@@ -70,7 +70,7 @@ impl Options {
pub fn from_cli(&self, other: Option<Command>) -> Options {
if let Some(Command::Options(options)) = other {
- Options::merge(&self, options)
+ Options::merge(self, options)
} else {
self.to_owned()
}