mirror of
https://github.com/kristoferssolo/transmission-rpc.git
synced 2025-10-21 20:10:37 +00:00
formatting
This commit is contained in:
parent
c3a586a73d
commit
18f35a09b3
@ -2,7 +2,9 @@ extern crate transmission_rpc;
|
||||
|
||||
use dotenv::dotenv;
|
||||
use std::env;
|
||||
use transmission_rpc::types::{BasicAuth, Result, RpcResponse, TorrentAddArgs, TorrentAddedOrDuplicate};
|
||||
use transmission_rpc::types::{
|
||||
BasicAuth, Result, RpcResponse, TorrentAddArgs, TorrentAddedOrDuplicate,
|
||||
};
|
||||
use transmission_rpc::TransClient;
|
||||
|
||||
#[tokio::main]
|
||||
|
||||
@ -549,7 +549,10 @@ impl TransClient {
|
||||
/// # Panics
|
||||
/// Either metainfo or torrent filename must be set or this call will panic.
|
||||
///
|
||||
pub async fn torrent_add(&mut self, add: TorrentAddArgs) -> Result<RpcResponse<TorrentAddedOrDuplicate>> {
|
||||
pub async fn torrent_add(
|
||||
&mut self,
|
||||
add: TorrentAddArgs,
|
||||
) -> Result<RpcResponse<TorrentAddedOrDuplicate>> {
|
||||
assert!(
|
||||
!(add.metainfo == None && add.filename == None),
|
||||
"Metainfo or Filename should be provided"
|
||||
|
||||
@ -179,7 +179,7 @@ pub struct Nothing {}
|
||||
impl RpcResponseArgument for Nothing {}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(rename_all="kebab-case")]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum TorrentAddedOrDuplicate {
|
||||
TorrentDuplicate(Torrent),
|
||||
TorrentAdded(Torrent),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user