Skip to content

Commit

Permalink
Change: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtsfrei committed Mar 1, 2024
1 parent e5b7c68 commit 2bde5a9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
1 change: 0 additions & 1 deletion rust/models/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ pub struct Scan {
/// List of VTs to execute for the target
pub vts: Vec<VT>,
}

2 changes: 1 addition & 1 deletion rust/openvas/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
pub mod cmd;
pub mod config;
pub mod error;
pub mod openvas;
pub mod openvas_redis;
pub mod pref_handler;
pub mod result_collector;
pub mod openvas;
pub use openvas::Scanner;
3 changes: 2 additions & 1 deletion rust/openvas/src/result_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ mod tests {
.as_ref()
.lock()
.unwrap()
.results.first()
.results
.first()
.unwrap()
),
single_r
Expand Down
6 changes: 5 additions & 1 deletion rust/openvasd/src/controller/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ impl<S, DB> ContextBuilder<S, DB, NoScanner> {

impl<S, DB> ContextBuilder<S, DB, Scanner<S>> {
pub fn build(self) -> Context<S, DB> {
let scheduler = scheduling::Scheduler::new(self.scheduler_config.unwrap_or_default(), self.scanner.0, self.storage);
let scheduler = scheduling::Scheduler::new(
self.scheduler_config.unwrap_or_default(),
self.scanner.0,
self.storage,
);
Context {
response: self.response,
scheduler,
Expand Down
8 changes: 5 additions & 3 deletions rust/openvasd/src/controller/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,11 @@ where
Err(scheduling::Error::NotFound) => {
Ok(ctx.response.not_found("scan", &id))
}
Err(scheduling::Error::QueueFull) => Ok(ctx
.response
.service_unavailable("Queue is already full. Try again later.")),
Err(scheduling::Error::QueueFull) => {
Ok(ctx.response.service_unavailable(
"Queue is already full. Try again later.",
))
}
Err(e) => Ok(ctx.response.internal_server_error(&e)),
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/openvasd/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ mod tests {
let controller = Arc::new(ctx);
let resp = post_scan(&scan, Arc::clone(&controller)).await;

assert_eq!(resp.status(), 201);
assert_eq!(resp.status(), 201);

let req: Request<Full<Bytes>> = Request::builder()
.uri("/scans")
Expand Down
4 changes: 1 addition & 3 deletions rust/openvasd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
)
.await
}
config::ScannerType::Openvas => {
run(openvas::Scanner::default(), &config).await
}
config::ScannerType::Openvas => run(openvas::Scanner::default(), &config).await,
}
}

0 comments on commit 2bde5a9

Please sign in to comment.