mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
ci: Add GitHub releases to CI (#95)
This commit is contained in:
+2
-2
@@ -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)
|
||||
|
||||
@@ -30,11 +30,3 @@ pub fn init(shell_name: &str) {
|
||||
print!("{}", script);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum Shell {
|
||||
Bash,
|
||||
Fish,
|
||||
Zsh,
|
||||
Unsupported(String),
|
||||
}
|
||||
|
||||
@@ -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
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user