neon_arch commited on
Commit
0d2d449
1 Parent(s): 65f5a4a

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

Browse files
Files changed (1) hide show
  1. src/lib.rs +6 -2
src/lib.rs CHANGED
@@ -1,6 +1,10 @@
1
  //! This main library module provides the functionality to provide and handle the Tcp server
2
  //! and register all the routes for the `websurfx` meta search engine website.
3
 
 
 
 
 
4
  pub mod cache;
5
  pub mod config;
6
  pub mod engines;
@@ -40,7 +44,7 @@ use handler::paths::{file_path, FileType};
40
  /// let server = run(listener,config).expect("Failed to start server");
41
  /// ```
42
  pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
43
- let mut handlebars: Handlebars = Handlebars::new();
44
 
45
  let public_folder_path: String = file_path(FileType::Theme)?;
46
 
@@ -48,7 +52,7 @@ pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
48
  .register_templates_directory(".html", format!("{}/templates", public_folder_path))
49
  .unwrap();
50
 
51
- let handlebars_ref: web::Data<Handlebars> = web::Data::new(handlebars);
52
 
53
  let cloned_config_threads_opt: u8 = config.threads;
54
 
 
1
  //! This main library module provides the functionality to provide and handle the Tcp server
2
  //! and register all the routes for the `websurfx` meta search engine website.
3
 
4
+ #![forbid(unsafe_code, clippy::panic)]
5
+ #![deny(missing_docs, clippy::missing_docs_in_private_items, clippy::perf)]
6
+ #![warn(clippy::cognitive_complexity, rust_2018_idioms)]
7
+
8
  pub mod cache;
9
  pub mod config;
10
  pub mod engines;
 
44
  /// let server = run(listener,config).expect("Failed to start server");
45
  /// ```
46
  pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
47
+ let mut handlebars: Handlebars<'_> = Handlebars::new();
48
 
49
  let public_folder_path: String = file_path(FileType::Theme)?;
50
 
 
52
  .register_templates_directory(".html", format!("{}/templates", public_folder_path))
53
  .unwrap();
54
 
55
+ let handlebars_ref: web::Data<Handlebars<'_>> = web::Data::new(handlebars);
56
 
57
  let cloned_config_threads_opt: u8 = config.threads;
58