about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-02T00·31+0100
committertazjin <mail@tazj.in>2020-08-02T21·57+0000
commit87d70d2a808849c7d64f499e13410378da200354 (patch)
tree521f2c1e18c19950fb0f884796d9570ca9a95c8d /tools
parentde27b3c1ff7ef347d14a1b361156fedbfd8f8558 (diff)
style(cheddar): Apply rustfmt r/1552
Change-Id: I378b5ae618b01244edc090ad1495fbd56857d7c0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1562
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/cheddar/src/main.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/tools/cheddar/src/main.rs b/tools/cheddar/src/main.rs
index cde056834063..25e8ff32878b 100644
--- a/tools/cheddar/src/main.rs
+++ b/tools/cheddar/src/main.rs
@@ -3,9 +3,10 @@ use comrak::arena_tree::Node;
 use comrak::nodes::{Ast, AstNode, NodeCodeBlock, NodeHtmlBlock, NodeValue};
 use comrak::{format_html, parse_document, Arena, ComrakOptions};
 use lazy_static::lazy_static;
-use rouille::{router, try_or_400};
 use rouille::Response;
+use rouille::{router, try_or_400};
 use serde::Deserialize;
+use serde_json::json;
 use std::cell::RefCell;
 use std::collections::HashMap;
 use std::env;
@@ -19,7 +20,6 @@ use syntect::easy::HighlightLines;
 use syntect::highlighting::{Theme, ThemeSet};
 use syntect::parsing::{SyntaxReference, SyntaxSet};
 use syntect::util::LinesWithEndings;
-use serde_json::json;
 
 use syntect::html::{
     append_highlighted_html_for_styled_line, start_highlighted_html_snippet, IncludeBackground,
@@ -304,12 +304,7 @@ fn code_endpoint(request: &rouille::Request) -> rouille::Response {
         _ => "Solarized (dark)",
     }];
 
-    format_code(
-        theme,
-        &mut query.code.as_bytes(),
-        &mut buf,
-        &query.filepath,
-    );
+    format_code(theme, &mut query.code.as_bytes(), &mut buf, &query.filepath);
 
     Response::json(&json!({
         "is_plaintext": false,
@@ -319,8 +314,7 @@ fn code_endpoint(request: &rouille::Request) -> rouille::Response {
 
 // Server endpoint for rendering a Markdown file.
 fn markdown_endpoint(request: &rouille::Request) -> rouille::Response {
-    let mut texts: HashMap<String, String> =
-        try_or_400!(rouille::input::json_input(request));
+    let mut texts: HashMap<String, String> = try_or_400!(rouille::input::json_input(request));
 
     for text in texts.values_mut() {
         let mut buf: Vec<u8> = Vec::new();