chiark / gitweb /
Tidy up a few rustfmt divergences.
authorSimon Tatham <anakin@pobox.com>
Sat, 3 Feb 2024 11:35:28 +0000 (11:35 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 3 Feb 2024 11:51:25 +0000 (11:51 +0000)
One of them misaligns Ian's list of test cases (sorry), but it does
have the advantage that I can M-x rust-format-buffer any time I've
made a mess, and not have to think too hard about tidying it up.

src/client.rs
src/editor.rs
src/main.rs
src/types.rs

index e15328f724a91c59e72749c6252cd354aea48318..8de75dcb221b5ef7b4434862d1a0ea25210b64ce 100644 (file)
@@ -715,7 +715,7 @@ impl Client {
                 Ok(y) => y,
                 Err(e) => {
                     return ClientError::InvalidJSONSyntax(url, e.to_string())
-                },
+                }
             };
             let val_restring = serde_json::to_string(&val)
                 .unwrap_or_else(|e| format!("failed to regenerate json! {e}"));
@@ -846,7 +846,7 @@ impl Client {
         &mut self,
         id: &str,
     ) -> Result<Relationship, ClientError> {
-       let req = Req::get("api/v1/accounts/relationships").param("id", id);
+        let req = Req::get("api/v1/accounts/relationships").param("id", id);
         let (rels, url) = self.api_request_parse::<Vec<Relationship>>(req)?;
         for rel in rels {
             if rel.id == id {
index 748f789874588fcb2b4b7857c42204571959edfc..2d6a28e30295554d1bfbd398e56e2a11434df888 100644 (file)
@@ -992,9 +992,10 @@ pub fn get_user_to_examine() -> Box<dyn ActivityState> {
                         reqwest::StatusCode::NOT_FOUND,
                         _,
                     )) => LogicalAction::Goto(
-                        OverlayActivity::BottomLineError(
-                            format!("User '{}' not found", s)
-                        )
+                        OverlayActivity::BottomLineError(format!(
+                            "User '{}' not found",
+                            s
+                        ))
                         .into(),
                     ),
 
@@ -1023,9 +1024,10 @@ pub fn get_post_id_to_read() -> Box<dyn ActivityState> {
                         reqwest::StatusCode::NOT_FOUND,
                         _,
                     )) => LogicalAction::Goto(
-                        OverlayActivity::BottomLineError(
-                            format!("Post id {} not found", s)
-                        )
+                        OverlayActivity::BottomLineError(format!(
+                            "Post id {} not found",
+                            s
+                        ))
                         .into(),
                     ),
 
index f45a62b43b22c68745ef5d76e94b20a036f5c8b5..3ad7311e0d23558a236b29e1e380ef23853c3647 100644 (file)
@@ -20,8 +20,8 @@ pub mod tui;
 pub mod types;
 
 use crate::config::ConfigLocation;
-use crate::tui::Tui;
 use crate::top_level_error::TopLevelError;
+use crate::tui::Tui;
 
 #[derive(Parser, Debug)]
 struct Args {
index d11e5b70c837c327b7919f5bfd31feba4b86c2ba..980dd87be29424bf6451a6bd8a9167dc9ff9a0c4 100644 (file)
@@ -70,8 +70,8 @@ fn test_supposedly_non_negative() {
         serde_json::from_str::<S>(j).unwrap_err();
     };
 
-    chk(r#"{ "a":  0 }"#,  0, "0");
-    chk(r#"{ "a":  1 }"#,  1, "1");
+    chk(r#"{ "a":  0 }"#, 0, "0");
+    chk(r#"{ "a":  1 }"#, 1, "1");
     chk(r#"{ "a": -1 }"#, -1, "unavailable");
     chk_err(r#"{}"#);
     chk_err(r#"{ "a": -42 }"#);