chore: add linting & formatting

This commit is contained in:
Ayo Ayco 2025-08-26 21:14:29 +02:00
parent 28da5dca70
commit c8fc98f3e5
4 changed files with 20 additions and 7 deletions

2
.clippy.toml Normal file
View file

@ -0,0 +1,2 @@
# .clippy.toml
allow-unwrap-in-tests = true

4
.gitignore vendored
View file

@ -1 +1,5 @@
/target
*~
*swo
*swp

10
.rustfmt.toml Normal file
View file

@ -0,0 +1,10 @@
# .rustfmt.toml
max_width = 100
hard_tabs = false
tab_spaces = 4
newline_style = "Auto"
use_small_heuristics = "Default"
indent_style = "Block"
wrap_comments = true
format_code_in_doc_comments = true
doc_comment_code_block_width = 100

View file

@ -1,5 +1,5 @@
// src/main.rs
use actix_web::{App, HttpResponse, HttpServer, Responder, web};
use actix_web::{App, HttpServer, Responder, web};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
@ -12,10 +12,7 @@ async fn main() -> std::io::Result<()> {
async fn index() -> impl Responder {
// Make GET request to the external API
let response = reqwest::get(
"https://fosstodon.org/api/v1/trends/statuses
",
)
let response = reqwest::get("https://fosstodon.org/api/v1/trends/statuses")
.await
.unwrap();