Skip to content

Commit 8e4a638

Browse files
committed
fmt
1 parent 706fb74 commit 8e4a638

3 files changed

Lines changed: 19 additions & 11 deletions

File tree

src/extensions/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ pub fn parse_episode_info(filename: &str) -> (Option<u32>, Option<u32>) {
7171
// Reconstruct the full matched number to check if it's a year
7272
let full_number = season * 100 + episode;
7373
// Only valid if episode isn't too high and the full number isn't a year (1900-2099)
74-
if (1..=99).contains(&season) && (1..=99).contains(&episode) && !(1900..=2099).contains(&full_number) {
74+
if (1..=99).contains(&season)
75+
&& (1..=99).contains(&episode)
76+
&& !(1900..=2099).contains(&full_number)
77+
{
7578
return (Some(season), Some(episode));
7679
}
7780
}

src/opensubtitles.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ pub struct SubtitleDownload {
5454

5555
impl OpenSubtitlesClient {
5656
pub fn new(api_key: &str) -> Self {
57-
let user_agent = format!(
58-
"{}/{}",
59-
env!("CARGO_PKG_NAME"),
60-
env!("CARGO_PKG_VERSION")
61-
);
57+
let user_agent = format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
6258

6359
let client = Client::builder()
6460
.user_agent(user_agent)

src/torznab.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,12 +518,18 @@ mod tests {
518518

519519
// magnet_url should be None, not Some("")
520520
assert_eq!(result.magnet_url, None);
521-
assert_eq!(result.link, Some("http://example.com/download.torrent".to_string()));
521+
assert_eq!(
522+
result.link,
523+
Some("http://example.com/download.torrent".to_string())
524+
);
522525

523526
// Get the torrent URL - this should return the valid link
524527
let url = result.get_torrent_url();
525-
assert_eq!(url, Some("http://example.com/download.torrent".to_string()),
526-
"Expected to get the valid download link, not empty string");
528+
assert_eq!(
529+
url,
530+
Some("http://example.com/download.torrent".to_string()),
531+
"Expected to get the valid download link, not empty string"
532+
);
527533
}
528534

529535
#[test]
@@ -552,7 +558,10 @@ mod tests {
552558

553559
// Get the torrent URL - should fall back to the valid link
554560
let url = result.get_torrent_url();
555-
assert_eq!(url, Some("http://example.com/download.torrent".to_string()),
556-
"Expected to get the valid download link, not construct invalid magnet");
561+
assert_eq!(
562+
url,
563+
Some("http://example.com/download.torrent".to_string()),
564+
"Expected to get the valid download link, not construct invalid magnet"
565+
);
557566
}
558567
}

0 commit comments

Comments
 (0)