summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.me>2019-07-14 17:54:45 -0400
committerGitHub <noreply@github.com>2019-07-14 17:54:45 -0400
commit0703a7404836a496d317497952cddbaf28f8bd2b (patch)
tree0070c724c73757b39d41ebabbf8cbf0e692fd31c /src
parent77ba97df191c5cebb3b0a9126e7e97fff28b0628 (diff)
ci: Add GitHub releases to CI (#95)
Diffstat (limited to 'src')
-rw-r--r--src/context.rs4
-rw-r--r--src/init.rs8
-rw-r--r--src/modules/directory.rs2
-rw-r--r--src/modules/rust.rs2
4 files changed, 4 insertions, 12 deletions
diff --git a/src/context.rs b/src/context.rs
index f62ea76cd..dd8e63435 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -146,7 +146,7 @@ impl<'a> ScanDir<'a> {
/// checks to see if the pathbuf matches a file or folder name
pub fn path_has_name<'a>(dir_entry: &PathBuf, names: &'a [&'a str]) -> bool {
- let found_file_or_folder_name = names.into_iter().find(|file_or_folder_name| {
+ let found_file_or_folder_name = names.iter().find(|file_or_folder_name| {
dir_entry
.file_name()
.and_then(OsStr::to_str)
@@ -162,7 +162,7 @@ pub fn path_has_name<'a>(dir_entry: &PathBuf, names: &'a [&'a str]) -> bool {
/// checks if pathbuf matches the extension provided
pub fn has_extension<'a>(dir_entry: &PathBuf, extensions: &'a [&'a str]) -> bool {
- let found_ext = extensions.into_iter().find(|ext| {
+ let found_ext = extensions.iter().find(|ext| {
dir_entry
.extension()
.and_then(OsStr::to_str)
diff --git a/src/init.rs b/src/init.rs
index 96881049c..5dc854d9a 100644
--- a/src/init.rs
+++ b/src/init.rs
@@ -30,11 +30,3 @@ pub fn init(shell_name: &str) {
print!("{}", script);
}
}
-
-#[derive(Debug)]
-enum Shell {
- Bash,
- Fish,
- Zsh,
- Unsupported(String),
-}
diff --git a/src/modules/directory.rs b/src/modules/directory.rs
index fe92c5c58..793551591 100644
--- a/src/modules/directory.rs
+++ b/src/modules/directory.rs
@@ -79,7 +79,7 @@ fn truncate(dir_string: String, length: usize) -> String {
return dir_string;
}
- let components = dir_string.split("/").collect::<Vec<&str>>();
+ let components = dir_string.split('/').collect::<Vec<&str>>();
if components.len() <= length {
return dir_string;
}
diff --git a/src/modules/rust.rs b/src/modules/rust.rs
index a89ae39d1..ccb007a02 100644
--- a/src/modules/rust.rs
+++ b/src/modules/rust.rs
@@ -45,7 +45,7 @@ fn get_rust_version() -> Option<String> {
}
fn format_rustc_version(mut rustc_stdout: String) -> String {
- let offset = &rustc_stdout.find('(').unwrap_or(rustc_stdout.len());
+ let offset = &rustc_stdout.find('(').unwrap_or_else(|| rustc_stdout.len());
let formatted_version: String = rustc_stdout.drain(..offset).collect();
format!("v{}", formatted_version.replace("rustc", "").trim())