ci: Add GitHub releases to CI (#95)

This commit is contained in:
Matan Kushner
2019-07-14 17:54:45 -04:00
committed by GitHub
parent 77ba97df19
commit 0703a74048
17 changed files with 367 additions and 83 deletions
+2 -2
View File
@@ -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)
-8
View File
@@ -30,11 +30,3 @@ pub fn init(shell_name: &str) {
print!("{}", script);
}
}
#[derive(Debug)]
enum Shell {
Bash,
Fish,
Zsh,
Unsupported(String),
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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())