Skip to content

Commit 123ae50

Browse files
committed
Remove default +stable toolchain when formatting
1 parent 3297454 commit 123ae50

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ jobs:
7474
- name: Ensure working directory is clean
7575
run: |
7676
git status
77-
git diff
7877
test -z "$(git status --porcelain)"
7978
8079
release:

src/renderVisitor.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ export function renderVisitor(path: string, options: RenderOptions = {}) {
2525
// format the code
2626
if (options.formatCode) {
2727
if (options.crateFolder) {
28-
const toolchain = options.toolchain ?? '+stable';
29-
runFormatter('cargo', [toolchain, 'fmt', '--manifest-path', `${options.crateFolder}/Cargo.toml`]);
28+
const removeFalsy = <T>(arg: T | false | null | undefined): arg is T => Boolean(arg);
29+
runFormatter(
30+
'cargo',
31+
[options.toolchain, 'fmt', '--manifest-path', `${options.crateFolder}/Cargo.toml`].filter(
32+
removeFalsy,
33+
),
34+
);
3035
} else {
3136
logWarn('No crate folder specified, skipping formatting.');
3237
}

0 commit comments

Comments
 (0)