diff --git a/docs/src/bin/build_nav.rs b/docs/src/bin/build_nav.rs
index 42568c3..04807c8 100644
--- a/docs/src/bin/build_nav.rs
+++ b/docs/src/bin/build_nav.rs
@@ -1,14 +1,10 @@
-use comrak::nodes::AstNode;
-use comrak::{self, Arena};
-use docs::page::{Page, COMRAK_OPTIONS};
-use docs::string_writer::StringWriter;
+use comrak::{self, nodes::AstNode, Arena};
+use docs::{
+    page::{Page, COMRAK_OPTIONS},
+    string_writer::StringWriter,
+};
 use serde_json;
-use std::env;
-use std::error::Error;
-use std::fs;
-use std::io;
-use std::path::Path;
-use std::str;
+use std::{env, error::Error, fs, io, path::Path, str};
 
 fn main() -> Result<(), Box<dyn Error>> {
     let args = env::args().collect::<Vec<_>>();
diff --git a/docs/src/bin/build_page.rs b/docs/src/bin/build_page.rs
index 0bcdabb..98da9f0 100644
--- a/docs/src/bin/build_page.rs
+++ b/docs/src/bin/build_page.rs
@@ -1,19 +1,28 @@
-use comrak::nodes::{AstNode, NodeCodeBlock, NodeHeading, NodeHtmlBlock, NodeLink, NodeValue};
-use comrak::{self, Arena};
-use docs::page::{Page, COMRAK_OPTIONS};
-use docs::views;
+use comrak::{
+    self,
+    nodes::{AstNode, NodeCodeBlock, NodeHeading, NodeHtmlBlock, NodeLink, NodeValue},
+    Arena,
+};
+use docs::{
+    page::{Page, COMRAK_OPTIONS},
+    views,
+};
 use serde_json;
-use std::env;
-use std::error::Error;
-use std::fs::{self, File};
-use std::io::BufReader;
-use std::mem;
-use std::path::Path;
-use std::str::{self, Utf8Error};
-use std::string::FromUtf8Error;
-use syntect::highlighting::{Color, ThemeSet};
-use syntect::html::highlighted_html_for_string;
-use syntect::parsing::SyntaxSet;
+use std::{
+    env,
+    error::Error,
+    fs::{self, File},
+    io::BufReader,
+    mem,
+    path::Path,
+    str::{self, Utf8Error},
+    string::FromUtf8Error,
+};
+use syntect::{
+    highlighting::{Color, ThemeSet},
+    html::highlighted_html_for_string,
+    parsing::SyntaxSet,
+};
 
 fn main() -> Result<(), Box<dyn Error>> {
     let args = env::args().collect::<Vec<_>>();
diff --git a/docs/src/page.rs b/docs/src/page.rs
index 5776257..baf0313 100644
--- a/docs/src/page.rs
+++ b/docs/src/page.rs
@@ -1,9 +1,8 @@
-use comrak::nodes::{AstNode, NodeHeading, NodeValue};
-use comrak::{Arena, ComrakOptions};
-use std::fs;
-use std::io;
-use std::lazy::SyncLazy;
-use std::path::Path;
+use comrak::{
+    nodes::{AstNode, NodeHeading, NodeValue},
+    Arena, ComrakOptions,
+};
+use std::{fs, io, lazy::SyncLazy, path::Path};
 
 pub struct Page<'a> {
     pub title: Option<&'a AstNode<'a>>,
diff --git a/docs/src/string_writer.rs b/docs/src/string_writer.rs
index 441430e..ea7291a 100644
--- a/docs/src/string_writer.rs
+++ b/docs/src/string_writer.rs
@@ -1,5 +1,4 @@
-use std::io;
-use std::str;
+use std::{io, str};
 
 pub struct StringWriter<'a>(pub &'a mut String);
 
diff --git a/docs/src/views.rs b/docs/src/views.rs
index 8dd2e8a..47bdc59 100644
--- a/docs/src/views.rs
+++ b/docs/src/views.rs
@@ -2,8 +2,10 @@ use comrak::nodes::AstNode;
 use maud::{html, Markup, PreEscaped, Render, DOCTYPE};
 use std::str;
 
-use crate::page::{Page, COMRAK_OPTIONS};
-use crate::string_writer::StringWriter;
+use crate::{
+    page::{Page, COMRAK_OPTIONS},
+    string_writer::StringWriter,
+};
 
 struct Comrak<'a>(&'a AstNode<'a>);
 
diff --git a/maud/src/lib.rs b/maud/src/lib.rs
index b30e1e3..adf707d 100644
--- a/maud/src/lib.rs
+++ b/maud/src/lib.rs
@@ -176,12 +176,13 @@ mod iron_support {
     extern crate std;
 
     use crate::PreEscaped;
-    use alloc::boxed::Box;
-    use alloc::string::String;
-    use iron::headers::ContentType;
-    use iron::modifier::{Modifier, Set};
-    use iron::modifiers::Header;
-    use iron::response::{Response, WriteBody};
+    use alloc::{boxed::Box, string::String};
+    use iron::{
+        headers::ContentType,
+        modifier::{Modifier, Set},
+        modifiers::Header,
+        response::{Response, WriteBody},
+    };
     use std::io;
 
     impl Modifier<Response> for PreEscaped<String> {
@@ -205,9 +206,11 @@ mod rocket_support {
 
     use crate::PreEscaped;
     use alloc::string::String;
-    use rocket::http::{ContentType, Status};
-    use rocket::request::Request;
-    use rocket::response::{Responder, Response};
+    use rocket::{
+        http::{ContentType, Status},
+        request::Request,
+        response::{Responder, Response},
+    };
     use std::io::Cursor;
 
     impl Responder<'static> for PreEscaped<String> {
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000..c3c8c37
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1 @@
+imports_granularity = "Crate"