Skip to content

Commit 1a28309

Browse files
committed
refactor: [#581] remove unused code
1 parent 07a3fb6 commit 1a28309

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

src/config/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,12 @@ impl Tsl {
226226
pub struct Configuration {
227227
/// The state of the configuration.
228228
pub settings: RwLock<TorrustIndex>,
229-
/// The path to the configuration file. This is `None` if the configuration
230-
/// was loaded from the environment.
231-
pub config_path: Option<String>,
232229
}
233230

234231
impl Default for Configuration {
235232
fn default() -> Configuration {
236233
Configuration {
237234
settings: RwLock::new(TorrustIndex::default()),
238-
config_path: None,
239235
}
240236
}
241237
}
@@ -268,7 +264,6 @@ impl Configuration {
268264

269265
Ok(Configuration {
270266
settings: RwLock::new(index_config),
271-
config_path: None,
272267
})
273268
}
274269

tests/environments/app_starter.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use torrust_index::{app, config};
1010
/// It launches the app and provides a way to stop it.
1111
pub struct AppStarter {
1212
configuration: config::TorrustIndex,
13-
config_path: Option<String>,
1413
/// The application binary state (started or not):
1514
/// - `None`: if the app is not started,
1615
/// - `RunningState`: if the app was started.
@@ -19,10 +18,9 @@ pub struct AppStarter {
1918

2019
impl AppStarter {
2120
#[must_use]
22-
pub fn with_custom_configuration(configuration: config::TorrustIndex, config_path: Option<String>) -> Self {
21+
pub fn with_custom_configuration(configuration: config::TorrustIndex) -> Self {
2322
Self {
2423
configuration,
25-
config_path,
2624
running_state: None,
2725
}
2826
}
@@ -35,7 +33,6 @@ impl AppStarter {
3533
pub async fn start(&mut self, api_version: Version) {
3634
let configuration = Configuration {
3735
settings: RwLock::new(self.configuration.clone()),
38-
config_path: self.config_path.clone(),
3936
};
4037

4138
// Open a channel to communicate back with this function

tests/environments/isolated.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ impl TestEnv {
3333
let temp_dir = TempDir::new().expect("failed to create a temporary directory");
3434

3535
let configuration = ephemeral(&temp_dir);
36-
// Even if we load the configuration from the environment variable, we
37-
// still need to provide a path to save the configuration when the
38-
// configuration is updated via the `POST /settings` endpoints.
39-
let config_path = format!("{}/config.toml", temp_dir.path().to_string_lossy());
4036

41-
let app_starter = AppStarter::with_custom_configuration(configuration, Some(config_path));
37+
let app_starter = AppStarter::with_custom_configuration(configuration);
4238

4339
Self { app_starter, temp_dir }
4440
}

0 commit comments

Comments
 (0)