Skip to content

Commit

Permalink
Update dependencies (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro committed Apr 8, 2023
1 parent 7abdb05 commit 8cf9c96
Show file tree
Hide file tree
Showing 21 changed files with 237 additions and 353 deletions.
341 changes: 198 additions & 143 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Expand Up @@ -19,20 +19,20 @@ disable-repo-management = []
travis-ci = { repository = "denisidoro/navi", branch = "master" }

[dependencies]
regex = { version = "1.6.0", default-features = false, features = ["std", "unicode-perl"] }
regex = { version = "1.7.3", default-features = false, features = ["std", "unicode-perl"] }
clap = { version = "4.2.1", features = ["derive", "cargo"] }
crossterm = "0.24.0"
crossterm = "0.26.1"
lazy_static = "1.4.0"
directories-next = "2.0.0"
walkdir = "2.3.2"
walkdir = "2.3.3"
shellwords = "1.1.0"
anyhow = "1.0.58"
thiserror = "1.0.31"
anyhow = "1.0.70"
thiserror = "1.0.40"
strip-ansi-escapes = "0.1.1"
edit = "0.1.4"
remove_dir_all = "0.7.0"
serde = { version = "1.0.140", features = ["derive"] }
serde_yaml = "0.8.26"
remove_dir_all = "0.8.2"
serde = { version = "1.0.159", features = ["derive"] }
serde_yaml = "0.9.21"

[lib]
name = "navi"
Expand Down
4 changes: 2 additions & 2 deletions src/clients/cheatsh.rs
Expand Up @@ -20,7 +20,7 @@ pub fn call(query: &str) -> Result<Vec<String>> {
let args = ["-qO-", &format!("cheat.sh/{}", query)];

let child = Command::new("wget")
.args(&args)
.args(args)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn();
Expand All @@ -38,7 +38,7 @@ Make sure wget is correctly installed.";

if let Some(0) = out.status.code() {
let stdout = out.stdout;
let plain_bytes = strip_ansi_escapes::strip(&stdout)?;
let plain_bytes = strip_ansi_escapes::strip(stdout)?;

let markdown = String::from_utf8(plain_bytes).context("Output is invalid utf8")?;
if markdown.starts_with("Unknown topic.") {
Expand Down
2 changes: 1 addition & 1 deletion src/clients/tldr.rs
Expand Up @@ -55,7 +55,7 @@ pub fn call(query: &str) -> Result<Vec<String>> {
let args = [query, "--markdown"];

let child = Command::new("tldr")
.args(&args)
.args(args)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down
4 changes: 2 additions & 2 deletions src/commands/core/actor.rs
Expand Up @@ -43,7 +43,7 @@ fn prompt_finder(

let child = shell::out()
.stdout(Stdio::piped())
.arg(&suggestion_command)
.arg(suggestion_command)
.spawn()
.map_err(|e| ShellSpawnError::new(suggestion_command, e))?;

Expand Down Expand Up @@ -207,7 +207,7 @@ pub fn act(

env_var::set(env_var::PREVIEW_INITIAL_SNIPPET, &snippet);
env_var::set(env_var::PREVIEW_TAGS, &tags);
env_var::set(env_var::PREVIEW_COMMENT, &comment);
env_var::set(env_var::PREVIEW_COMMENT, comment);

let interpolated_snippet = {
let mut s = replace_variables_from_snippet(
Expand Down
4 changes: 2 additions & 2 deletions src/commands/func/widget.rs
Expand Up @@ -30,8 +30,8 @@ pub fn last_command() -> Result<()> {
}

for (pattern, escaped) in replacements.clone() {
text = text.replace(&escaped, pattern);
extracted = extracted.replace(&escaped, pattern);
text = text.replace(escaped, pattern);
extracted = extracted.replace(escaped, pattern);
}

println!("{}", extracted.trim_start());
Expand Down
2 changes: 1 addition & 1 deletion src/commands/preview/var.rs
Expand Up @@ -94,7 +94,7 @@ impl Runnable for Input {
value
} else if is_current {
finder::process(value, column, delimiter.as_deref(), map.clone())
.expect("Unable to process value")
.expect("Unable to process value")
} else {
"".to_string()
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/repo/browse.rs
Expand Up @@ -29,7 +29,7 @@ pub fn main() -> Result<String> {
p
};

let repos = fs::read_to_string(&feature_repos_file).context("Unable to fetch featured repositories")?;
let repos = fs::read_to_string(feature_repos_file).context("Unable to fetch featured repositories")?;

let opts = FinderOpts {
column: Some(1),
Expand Down
21 changes: 0 additions & 21 deletions src/common/component.rs.bkp

This file was deleted.

7 changes: 0 additions & 7 deletions src/common/deps.rs.bkp

This file was deleted.

50 changes: 0 additions & 50 deletions src/common/deser.rs.bkp

This file was deleted.

2 changes: 1 addition & 1 deletion src/common/git.rs
Expand Up @@ -4,7 +4,7 @@ use std::process::Command;

pub fn shallow_clone(uri: &str, target: &str) -> Result<()> {
Command::new("git")
.args(&["clone", uri, target, "--depth", "1"])
.args(["clone", uri, target, "--depth", "1"])
.spawn()
.map_err(|e| ShellSpawnError::new("git clone", e))?
.wait()
Expand Down
2 changes: 1 addition & 1 deletion src/common/shell.rs
Expand Up @@ -38,7 +38,7 @@ pub fn out() -> Command {
let mut words_vec = shellwords::split(&words_str).expect("empty shell command");
let mut words = words_vec.iter_mut();
let first_cmd = words.next().expect("absent shell binary");
let mut cmd = Command::new(&first_cmd);
let mut cmd = Command::new(first_cmd);
cmd.args(words);
let dash_c = if words_str.contains("cmd.exe") { "/c" } else { "-c" };
cmd.arg(dash_c);
Expand Down
57 changes: 0 additions & 57 deletions src/common/system.rs.bkp

This file was deleted.

36 changes: 0 additions & 36 deletions src/common/tracing.rs.bkp

This file was deleted.

4 changes: 2 additions & 2 deletions src/filesystem.rs
Expand Up @@ -13,7 +13,7 @@ use std::path::MAIN_SEPARATOR;
use walkdir::WalkDir;

pub fn all_cheat_files(path: &Path) -> Vec<String> {
WalkDir::new(&path)
WalkDir::new(path)
.follow_links(true)
.into_iter()
.filter_map(|e| e.ok())
Expand Down Expand Up @@ -91,7 +91,7 @@ fn interpolate_paths(paths: String) -> String {
let mut newtext = paths.to_string();
for capture in re.captures_iter(&paths) {
if let Some(c) = capture.get(0) {
let varname = c.as_str().replace('$', "").replace('{', "").replace('}', "");
let varname = c.as_str().replace(['$', '{', '}'], "");
if let Ok(replacement) = &env_var::get(&varname) {
newtext = newtext
.replace(&format!("${}", varname), replacement)
Expand Down
26 changes: 13 additions & 13 deletions src/finder/mod.rs
Expand Up @@ -56,7 +56,7 @@ impl FinderChoice {
Self::Skim => "sk",
};

let mut command = Command::new(&finder_str);
let mut command = Command::new(finder_str);
let opts = finder_opts.clone();

let preview_height = match self {
Expand All @@ -70,7 +70,7 @@ impl FinderChoice {
""
};

command.args(&[
command.args([
"--preview",
"",
"--preview-window",
Expand All @@ -97,48 +97,48 @@ impl FinderChoice {
}
SuggestionType::Disabled => {
if let Self::Fzf = self {
command.args(&["--print-query", "--no-select-1"]);
command.args(["--print-query", "--no-select-1"]);
};
}
SuggestionType::SnippetSelection => {
command.args(&["--expect", "ctrl-y,ctrl-o,enter"]);
command.args(["--expect", "ctrl-y,ctrl-o,enter"]);
}
SuggestionType::SingleRecommendation => {
command.args(&["--print-query", "--expect", "tab,enter"]);
command.args(["--print-query", "--expect", "tab,enter"]);
}
_ => {}
}

if let Some(p) = opts.preview {
command.args(&["--preview", &p]);
command.args(["--preview", &p]);
}

if let Some(q) = opts.query {
command.args(&["--query", &q]);
command.args(["--query", &q]);
}

if let Some(f) = opts.filter {
command.args(&["--filter", &f]);
command.args(["--filter", &f]);
}

if let Some(d) = opts.delimiter {
command.args(&["--delimiter", &d]);
command.args(["--delimiter", &d]);
}

if let Some(h) = opts.header {
command.args(&["--header", &h]);
command.args(["--header", &h]);
}

if let Some(p) = opts.prompt {
command.args(&["--prompt", &p]);
command.args(["--prompt", &p]);
}

if let Some(pw) = opts.preview_window {
command.args(&["--preview-window", &pw]);
command.args(["--preview-window", &pw]);
}

if opts.header_lines > 0 {
command.args(&["--header-lines", format!("{}", opts.header_lines).as_str()]);
command.args(["--header-lines", format!("{}", opts.header_lines).as_str()]);
}

if let Some(o) = opts.overrides {
Expand Down

0 comments on commit 8cf9c96

Please sign in to comment.