commit:     b246a4aa6846c43791bff586c154877719f8830c
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  1 22:21:56 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Jan  1 22:21:56 2020 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=b246a4aa

Fix code style

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 rust.eselect.in | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/rust.eselect.in b/rust.eselect.in
index 8e4ea3a..9de7149 100644
--- a/rust.eselect.in
+++ b/rust.eselect.in
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 DESCRIPTION="Manage the Rust compiler versions"
@@ -77,9 +77,11 @@ get_postfix() {
 get_current_target() {
        local i targets=( $(find_targets) )
        for (( i = 0; i < ${#targets[@]}; i++ )); do
-               [[ rustc-$(get_postfix ${targets[i]}) = \
-                       $(basename "$(canonicalise "${BIN_DIR}/rustc")") ]] \
-               && echo $i && return 0
+               if [[ rustc-$(get_postfix ${targets[i]}) = \
+                       $(basename "$(canonicalise "${BIN_DIR}/rustc")") ]]; 
then
+                       echo $i
+                       return 0
+               fi
        done
        echo "NOT_SET"
 }
@@ -90,7 +92,7 @@ get_symlinks_from_file() {
        local symlinks=()
        local i
        if [[ -e ${filename} ]]; then
-               for i in `cat "${filename}"`; do
+               for i in $(cat "${filename}"); do
                        symlinks+=($i)
                done
        fi
@@ -193,8 +195,8 @@ set_version() {
        done
 
        cp "${ENV_D_PATH}/rust/provider-${target}" \
-          "${ENV_D_PATH}/rust/last-set" || \
-           die -q "symlink list copying failed"
+               "${ENV_D_PATH}/rust/last-set" \
+               || die -q "symlink list copying failed"
 }
 
 ### cleanup action ###
@@ -250,16 +252,16 @@ describe_set() {
 }
 
 describe_set_parameters() {
-    echo "<target>"
+       echo "<target>"
 }
 
 describe_set_options() {
-    echo "target : Target number (from 'list' action)"
+       echo "target : Target number (from 'list' action)"
 }
 
 do_set() {
-    [[ -z $1 ]] && die -q "You didn't tell me what to set the version to"
-    [[ $# -gt 1 ]] && die -q "Too many parameters"
+       [[ -z $1 ]] && die -q "You didn't tell me what to set the version to"
+       [[ $# -gt 1 ]] && die -q "Too many parameters"
 
        set_version "$1" || die -q "Couldn't set new active version"
 }

Reply via email to