Skip to content

Commit

Permalink
run cargo fmt --check on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatson committed Nov 6, 2024
1 parent e31854c commit 78363d6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
- run: rustup override set ${{ matrix.rust_version }}
- name: cargo check
run: cargo check
- name: cargo fmt --check
run: cargo fmt --check
test:
strategy:
matrix:
Expand Down
41 changes: 33 additions & 8 deletions crates/librqbit/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,19 @@ impl Api {
let handle = self.mgr_handle(idx)?;
let info_hash = handle.shared().info_hash;
let only_files = handle.only_files();
let output_folder = handle.shared().options.output_folder.to_string_lossy().into_owned().to_string();
make_torrent_details(&info_hash, &handle.shared().info, only_files.as_deref(), output_folder)

let output_folder = handle
.shared()
.options
.output_folder
.to_string_lossy()
.into_owned()
.to_string();
make_torrent_details(
&info_hash,
&handle.shared().info,
only_files.as_deref(),
output_folder,
)
}

pub fn api_session_stats(&self) -> SessionStatsSnapshot {
Expand Down Expand Up @@ -343,7 +353,12 @@ impl Api {
&handle.info_hash(),
&handle.shared().info,
handle.only_files().as_deref(),
handle.shared().options.output_folder.to_string_lossy().into_owned(),
handle
.shared()
.options
.output_folder
.to_string_lossy()
.into_owned(),
)
.context("error making torrent details")?;
ApiAddTorrentResponse {
Expand All @@ -369,15 +384,25 @@ impl Api {
id: None,
output_folder: output_folder.to_string_lossy().into_owned(),
seen_peers: Some(seen_peers),
details: make_torrent_details(&info_hash, &info, only_files.as_deref(), output_folder.to_string_lossy().into_owned().to_string())
.context("error making torrent details")?,
details: make_torrent_details(
&info_hash,
&info,
only_files.as_deref(),
output_folder.to_string_lossy().into_owned().to_string(),
)
.context("error making torrent details")?,
},
AddTorrentResponse::Added(id, handle) => {
let details = make_torrent_details(
&handle.info_hash(),
&handle.shared().info,
handle.only_files().as_deref(),
handle.shared().options.output_folder.to_string_lossy().into_owned(),
handle.only_files().as_deref(),
handle
.shared()
.options
.output_folder
.to_string_lossy()
.into_owned(),
)
.context("error making torrent details")?;
ApiAddTorrentResponse {
Expand Down

0 comments on commit 78363d6

Please sign in to comment.