0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-22 14:08:23 -05:00

⚙️ refactor: add lints to the codebase to ensure proper code style (#205)

This commit is contained in:
neon_arch 2023-09-03 19:21:23 +03:00
parent 65f5a4ab0a
commit 0d2d449889

View File

@ -1,6 +1,10 @@
//! This main library module provides the functionality to provide and handle the Tcp server //! This main library module provides the functionality to provide and handle the Tcp server
//! and register all the routes for the `websurfx` meta search engine website. //! and register all the routes for the `websurfx` meta search engine website.
#![forbid(unsafe_code, clippy::panic)]
#![deny(missing_docs, clippy::missing_docs_in_private_items, clippy::perf)]
#![warn(clippy::cognitive_complexity, rust_2018_idioms)]
pub mod cache; pub mod cache;
pub mod config; pub mod config;
pub mod engines; pub mod engines;
@ -40,7 +44,7 @@ use handler::paths::{file_path, FileType};
/// let server = run(listener,config).expect("Failed to start server"); /// let server = run(listener,config).expect("Failed to start server");
/// ``` /// ```
pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> { pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
let mut handlebars: Handlebars = Handlebars::new(); let mut handlebars: Handlebars<'_> = Handlebars::new();
let public_folder_path: String = file_path(FileType::Theme)?; let public_folder_path: String = file_path(FileType::Theme)?;
@ -48,7 +52,7 @@ pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
.register_templates_directory(".html", format!("{}/templates", public_folder_path)) .register_templates_directory(".html", format!("{}/templates", public_folder_path))
.unwrap(); .unwrap();
let handlebars_ref: web::Data<Handlebars> = web::Data::new(handlebars); let handlebars_ref: web::Data<Handlebars<'_>> = web::Data::new(handlebars);
let cloned_config_threads_opt: u8 = config.threads; let cloned_config_threads_opt: u8 = config.threads;