Session persistence
This commit is contained in:
parent
e467787c38
commit
bec5e1be7f
7 changed files with 204 additions and 51 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue