diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..d4094a2 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +max_width = 79 +reorder_imports = true \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 4bec51a..34676cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,7 +44,8 @@ fn rocket() -> _ { let args = get_parsed_args(); // create the upload directory, if not already created - fs::create_dir_all(args.upload).expect("Could not create the upload directory"); + fs::create_dir_all(args.upload) + .expect("Could not create the upload directory"); rocket::build() .mount( diff --git a/src/models/pretty.rs b/src/models/pretty.rs index 9750dea..d2c9072 100644 --- a/src/models/pretty.rs +++ b/src/models/pretty.rs @@ -8,7 +8,8 @@ use syntect::parsing::SyntaxSet; pub fn get_pretty_body(path: &PathBuf, ext: &String) -> String { let ss = SyntaxSet::load_defaults_newlines(); - let mut theme_cursor = std::io::Cursor::new(include_bytes!("../../themes/ayu_dark.tmTheme")); + let mut theme_cursor = + std::io::Cursor::new(include_bytes!("../../themes/ayu_dark.tmTheme")); let theme = ThemeSet::load_from_reader(&mut theme_cursor).unwrap(); let content = fs::read_to_string(path).unwrap(); diff --git a/src/routes/pretty_retrieve_ext.rs b/src/routes/pretty_retrieve_ext.rs index 885147e..1a64251 100644 --- a/src/routes/pretty_retrieve_ext.rs +++ b/src/routes/pretty_retrieve_ext.rs @@ -8,7 +8,9 @@ use crate::models::pretty::get_pretty_body; use crate::models::pretty_syntax::PasteIdSyntax; #[get("/p/", rank = 1)] -pub async fn pretty_retrieve_ext(id_ext: PasteIdSyntax<'_>) -> Option