Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test_build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ jobs:
run: cargo clippy --all-targets -- -D clippy::pedantic
- name: Test Documentation
run: cargo test --doc
- name: Run Tests
run: cargo test --workspace
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- name: Run Tests
- name: Show coverage
run: cargo llvm-cov nextest

build:
Expand Down
61 changes: 3 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ serde = { version = "1.0", features = ["derive"] }
serde_bencode = "^0.2"
serde_json = "1.0"
serde_with = "2.0"
hex = "0.4"
percent-encoding = "2.2"
binascii = "0.1"
lazy_static = "1.4"
openssl = { version = "0.10", features = ["vendored"] }
config = "0.13"
toml = "0.7"
log = { version = "0.4", features = ["release_max_level_info"] }
fern = "0.6"
chrono = "0.4"
Expand Down
2 changes: 2 additions & 0 deletions packages/configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ log = { version = "0.4", features = ["release_max_level_info"] }
thiserror = "1.0"
torrust-tracker-primitives = { version = "3.0.0-alpha.1", path = "../primitives" }
torrust-tracker-located-error = { version = "3.0.0-alpha.1", path = "../located-error" }

[dev-dependencies]
uuid = { version = "1", features = ["v4"] }
10 changes: 7 additions & 3 deletions packages/configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,14 @@ impl Configuration {
/// permission to read it. Will also return `Err` if the configuration is
/// not valid or cannot be encoded to TOML.
pub fn save_to_file(&self, path: &str) -> Result<(), Error> {
let toml_string = toml::to_string(self).expect("Could not encode TOML value");
fs::write(path, toml_string).expect("Could not write to file!");
fs::write(path, self.to_toml()).expect("Could not write to file!");
Ok(())
}

/// Encodes the configuration to TOML.
fn to_toml(&self) -> String {
toml::to_string(self).expect("Could not encode TOML value")
}
}

#[cfg(test)]
Expand All @@ -575,11 +579,11 @@ mod tests {
db_path = "./storage/database/data.db"
announce_interval = 120
min_announce_interval = 120
max_peer_timeout = 900
on_reverse_proxy = false
external_ip = "0.0.0.0"
tracker_usage_statistics = true
persistent_torrent_completed_stat = false
max_peer_timeout = 900
inactive_peer_cleanup_interval = 600
remove_peerless_torrents = true

Expand Down
3 changes: 3 additions & 0 deletions packages/located-error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ edition.workspace = true

[dependencies]
log = { version = "0.4", features = ["release_max_level_info"] }

[dev-dependencies]
thiserror = "1.0"

1 change: 0 additions & 1 deletion packages/test-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ authors.workspace = true
edition.workspace = true

[dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "net", "sync", "macros", "signal"] }
lazy_static = "1.4"
rand = "0.8.5"
torrust-tracker-configuration = { version = "3.0.0-alpha.1", path = "../configuration"}
Expand Down