2 Star 0 Fork 0

mirrors_sfackler/gimli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
format 769 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env bash
# Usage:
# ./format
#
# Run `rustfmt` on all the Rust source files in this project, modifying them in
# place. Usually, one would use `cargo fmt` for this task, but that seems to be
# broken for me at the moment.
RUSTFMT=""
function maybe_set() {
if [[ $RUSTFMT == "" && -f "$1" ]]; then
RUSTFMT="$1"
fi
}
maybe_set ~/.cargo/bin/rustfmt
maybe_set $(which rustfmt)
maybe_set ~/.multirust/toolchains/nightly/cargo/bin/rustfmt
if [[ $RUSTFMT == "" ]]; then
echo "$0: error: could not find an appropriate rustfmt binary!"
exit 1
fi
echo "$0: using rustfmt=$RUSTFMT"
cd $(dirname $0)
RUST_FILES=$(git ls-files | grep '\.rs')
$RUSTFMT -v --write-mode overwrite $RUST_FILES 2>&1 \
| xargs -I '{}' echo "rustfmt: {}"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_sfackler/gimli.git
[email protected]:mirrors_sfackler/gimli.git
mirrors_sfackler
gimli
gimli
master

搜索帮助