Repository: ALU-Schumacher/AUDITOR (language: rust)

Issue:
Slurm Collector: collector_addr and collector_port never used -> clippy error
With the new Rust version 1.79 clippy fails with `error: fields collector_addr and collector_port are never read`.
We could remove these fields, since they are not used, or tell clippy to ignore dead code.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ab7ade1a9..5bb58df71 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Auditor: Use workspace dependencies ([@dirksammel](https://github.com/dirksammel))
 - Dependencies: Update actix-web from 4.5.1 to 4.6.0 ([@dirksammel](https://github.com/dirksammel))
 - Dependencies: Update anyhow from 1.0.82 to 1.0.86 ([@dirksammel](https://github.com/dirksammel))
+- Slurm collector: Remove fields `collector_addr` and `collector_port` in settings struct ([@raghuvar-vijay](https://github.com/raghuvar-vijay))
 - Dependencies: Update black from 24.2.0 to 24.4.2 ([@dirksammel](https://github.com/dirksammel))
 - Dependencies: Update crate-ci/typos from 1.20.7 to 1.22.7 ([@dirksammel](https://github.com/dirksammel))
 - Dependencies: Update criterion-macro from 0.3.4 to 0.4.0 ([@dirksammel](https://github.com/dirksammel))
diff --git a/collectors/slurm/src/configuration.rs b/collectors/slurm/src/configuration.rs
index feea69d4b..b53c1ec9b 100644
--- a/collectors/slurm/src/configuration.rs
+++ b/collectors/slurm/src/configuration.rs
@@ -20,11 +20,6 @@ use tracing_subscriber::filter::LevelFilter;
 #[derive(serde::Deserialize, Debug, Clone)]
 #[serde(deny_unknown_fields)]
 pub struct Settings {
-    #[serde(default = "default_collector_addr")]
-    pub collector_addr: String,
-    #[serde(deserialize_with = "deserialize_number_from_string")]
-    #[serde(default = "default_collector_port")]
-    pub collector_port: u16,
     #[serde(default = "default_addr")]
     pub addr: String,
     #[serde(deserialize_with = "deserialize_number_from_string")]
@@ -172,18 +167,10 @@ fn default_addr() -> String {
     "127.0.0.1".to_string()
 }
 
-fn default_collector_addr() -> String {
-    "0.0.0.0".to_string()
-}
-
 fn default_port() -> u16 {
     8000
 }
 
-fn default_collector_port() -> u16 {
-    4687
-}
-
 fn default_record_prefix() -> String {
     "slurm".to_string()
 }


Test patch: