Fix rust item

This commit is contained in:
Ilan Cosman 2020-08-20 08:44:50 -07:00
parent 451de67d2a
commit 4c0e3205a1

View File

@ -1,14 +1,12 @@
function _tide_item_rust function _tide_item_rust
if not type --quiet rustc || not test -e Cargo.toml || test (count *.rs) -gt 0 if type --quiet rustc && test -e Cargo.toml -o (count *.rs) -gt 0
return set -l rustVersion (rustc --version | string split ' ')[2]
if test "$tide_rust_verbose_version" = false
set rustVersion (string split '-' $rustVersion)[1] # Cut off -suffixes from version. "v1.30.0-beta" vs "v1.30.0"
end
set_color $tide_rust_color
printf '%s' {$tide_rust_icon}' ' $rustVersion
end end
set -l rustVersion (rustc --version | string split ' ')[2]
if test "$tide_rust_verbose_version" = false
set rustVersion (string split '-' $rustVersion)[1] # Cut off -suffixes from version. "v1.30.0-beta" vs "v1.30.0"
end
set_color $tide_rust_color
printf '%s' {$tide_rust_icon}' ' $rustVersion
end end