Reformat rust code using 1.40 rustfmt and fail build if rustfmt fails (#2339)

diff --git a/test/rs/Makefile.am b/test/rs/Makefile.am
index 4b061ea..afb2cad 100644
--- a/test/rs/Makefile.am
+++ b/test/rs/Makefile.am
@@ -22,6 +22,7 @@
 
 precross: stubs
 	$(CARGO) build
+	$(CARGO) fmt --all -- --check
 	[ -d bin ] || mkdir bin
 	cp target/debug/test_server bin/test_server
 	cp target/debug/test_client bin/test_client