Skip to content

Commit 77156cf

Browse files
committed
fix(native_config): implement default for RariaConfig struct
1 parent 70bd652 commit 77156cf

2 files changed

Lines changed: 2 additions & 16 deletions

File tree

crates/raria-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ mod native_projection_tests {
286286
assert_eq!(piece.id, "piece_1");
287287
assert_eq!(piece.hash_algorithm, "sha-256");
288288
assert_eq!(piece.expected_hash, "abc123");
289-
assert_eq!(piece.verified, false);
289+
assert!(!piece.verified);
290290
}
291291

292292
#[test]

crates/raria-core/src/native_config.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
66
use std::path::{Path, PathBuf};
77

88
/// Top-level native raria configuration.
9-
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9+
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1010
#[serde(deny_unknown_fields)]
1111
pub struct RariaConfig {
1212
/// Daemon process settings.
@@ -80,20 +80,6 @@ impl RariaConfig {
8080
}
8181
}
8282

83-
impl Default for RariaConfig {
84-
fn default() -> Self {
85-
Self {
86-
daemon: DaemonConfig::default(),
87-
api: ApiConfig::default(),
88-
downloads: DownloadsConfig::default(),
89-
network: NetworkConfig::default(),
90-
bittorrent: BitTorrentConfig::default(),
91-
storage: StorageConfig::default(),
92-
logging: LoggingConfig::default(),
93-
}
94-
}
95-
}
96-
9783
/// Daemon process settings.
9884
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
9985
#[serde(default, deny_unknown_fields)]

0 commit comments

Comments
 (0)