Session persistence

This commit is contained in:
Igor Katson 2023-11-25 02:36:19 +00:00
parent e467787c38
commit bec5e1be7f
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
7 changed files with 204 additions and 51 deletions

View file

@ -41,6 +41,17 @@ impl Magnet {
}
}
impl std::fmt::Display for Magnet {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"magnet:?xt=urn:btih:{}&tr={}",
self.info_hash.as_string(),
self.trackers.join("&tr=")
)
}
}
#[cfg(test)]
mod tests {
#[test]