代码拉取完成,页面将自动刷新
#!/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: {}"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。