comply to style guidelines
use crate::types::resource::Subtitles;
#[cfg(test)]
use derivative::Derivative;
+use magnet_url::Magnet;
use serde::{Deserialize, Serialize};
use serde_hex::{SerHex, Strict};
use std::collections::HashMap;
use url::Url;
-use magnet_url::Magnet;
#[derive(Clone, PartialEq, Serialize, Deserialize)]
#[cfg_attr(debug_assertions, derive(Debug))]
@@ -26,8 +26,11 @@ pub struct Stream {
impl Stream {
pub fn magnet_url(&self) -> Option<Magnet> {
match &self.source {
- StreamSource::Torrent { info_hash, announce, .. } => {
- Some(Magnet {
+ StreamSource::Torrent {
+ info_hash,
+ announce,
+ ..
+ } => Some(Magnet {
dn: self.title.to_owned(),
hash_type: Some("btih".to_string()),
xt: Some(hex::encode(info_hash).to_string()),
@@ -42,9 +45,8 @@ impl Stream {
acceptable_source: Some(String::new()),
mt: Some(String::new()),
xs: Some(String::new()),
- })
- },
- _ => None
+ }),
+ _ => None,
}
}
}
