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

diff --git a/lib/rs/test/Makefile.am b/lib/rs/test/Makefile.am
index 5dc4f56..19056a6 100644
--- a/lib/rs/test/Makefile.am
+++ b/lib/rs/test/Makefile.am
@@ -28,6 +28,7 @@
 	$(THRIFT) -out src --gen rs $(top_builddir)/test/Identifiers.thrift #THRIFT-4953
 
 check: stubs
+	$(CARGO) fmt --all -- --check
 	$(CARGO) build
 	$(CARGO) test
 	[ -d bin ] || mkdir bin