From fd30d911d813ff3d58e91b3b760c5f7873c8b6cc Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Wed, 24 Mar 2021 00:00:40 +0100 Subject: [PATCH] Run cargo fmt in parallel --- utils/devtool.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/utils/devtool.rb b/utils/devtool.rb index 4f870069..c29987bb 100755 --- a/utils/devtool.rb +++ b/utils/devtool.rb @@ -42,10 +42,6 @@ class TutorialCrate end def fmt_cargo_rust(args) - print 'Rust cargo fmt '.light_blue - print "#{args} ".light_blue unless args.nil? - puts @folder - Dir.chdir(@folder) { exit(1) unless system("cargo fmt #{args}") } end @@ -216,7 +212,14 @@ class DevTool def fmt_cargo_rust(check: false) args = '-- --check' if check - @crates.each { |c| c.fmt_cargo_rust(args) } + @crates.each do |c| + print 'Rust cargo fmt '.light_blue + print "#{args} ".light_blue unless args.nil? + puts c.folder + + Process.fork { c.fmt_cargo_rust(args) } + end + Process.waitall end def fmt_prettier(check: false)