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

diff --git a/lib/rs/src/transport/buffered.rs b/lib/rs/src/transport/buffered.rs
index ebdcdc2..a54f823 100644
--- a/lib/rs/src/transport/buffered.rs
+++ b/lib/rs/src/transport/buffered.rs
@@ -365,7 +365,7 @@
         assert_eq!(&buf, &[0, 1, 2, 3, 4, 5, 6, 7]);
 
         // let's clear out the buffer and try read again
-        for b in &mut buf{
+        for b in &mut buf {
             *b = 0;
         }
         let read_result = t.read(&mut buf);
diff --git a/lib/rs/src/transport/mod.rs b/lib/rs/src/transport/mod.rs
index d02a87c..2b5733f 100644
--- a/lib/rs/src/transport/mod.rs
+++ b/lib/rs/src/transport/mod.rs
@@ -111,7 +111,12 @@
     /// Returned halves may share the underlying OS channel or buffer resources.
     /// Implementations **should ensure** that these two halves can be safely
     /// used independently by concurrent threads.
-    fn split(self) -> crate::Result<(crate::transport::ReadHalf<Self>, crate::transport::WriteHalf<Self>)>
+    fn split(
+        self,
+    ) -> crate::Result<(
+        crate::transport::ReadHalf<Self>,
+        crate::transport::WriteHalf<Self>,
+    )>
     where
         Self: Sized;
 }