use repeat instead of string multiplication (#612)

This commit is contained in:
baehyunsol 2023-09-21 20:20:49 +09:00 committed by GitHub
parent 36a45f28a3
commit 79fcd05525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,8 @@
use std repeat;
# Go up a number of directories
def-env up [
limit = 1: int # The number of directories to go up (default is 1)
] {
cd ("." * ($limit + 1))
cd ("." | repeat ($limit + 1) | str join)
}