Skip to content

Commit 4a9a4de

Browse files
committed
Formatting
1 parent aea4389 commit 4a9a4de

File tree

3 files changed

+67
-17
lines changed

3 files changed

+67
-17
lines changed

atrium-xrpc/src/traits.rs

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,22 @@ pub trait HttpClient {
1414
fn send_http(
1515
&self,
1616
request: Request<Vec<u8>>,
17-
) -> impl Future<Output = core::result::Result<Response<Vec<u8>>, Box<dyn std::error::Error + Send + Sync + 'static>>>;
17+
) -> impl Future<
18+
Output = core::result::Result<
19+
Response<Vec<u8>>,
20+
Box<dyn std::error::Error + Send + Sync + 'static>,
21+
>,
22+
>;
1823
#[cfg(not(target_arch = "wasm32"))]
1924
fn send_http(
2025
&self,
2126
request: Request<Vec<u8>>,
22-
) -> impl Future<Output = core::result::Result<Response<Vec<u8>>, Box<dyn std::error::Error + Send + Sync + 'static>>> + Send;
27+
) -> impl Future<
28+
Output = core::result::Result<
29+
Response<Vec<u8>>,
30+
Box<dyn std::error::Error + Send + Sync + 'static>,
31+
>,
32+
> + Send;
2333
}
2434

2535
type XrpcResult<O, E> = core::result::Result<OutputDataOrBytes<O>, self::Error<E>>;
@@ -39,7 +49,10 @@ pub trait XrpcClient: HttpClient {
3949
}
4050
#[allow(unused_variables)]
4151
#[cfg(not(target_arch = "wasm32"))]
42-
fn authentication_token(&self, is_refresh: bool) -> impl Future<Output = Option<String>> + Send {
52+
fn authentication_token(
53+
&self,
54+
is_refresh: bool,
55+
) -> impl Future<Output = Option<String>> + Send {
4356
async { None }
4457
}
4558
/// Get the `atproto-proxy` header.
@@ -62,7 +75,10 @@ pub trait XrpcClient: HttpClient {
6275
}
6376
/// Send an XRPC request and return the response.
6477
#[cfg(target_arch = "wasm32")]
65-
fn send_xrpc<P, I, O, E>(&self, request: &XrpcRequest<P, I>) -> impl Future<Output = XrpcResult<O, E>>
78+
fn send_xrpc<P, I, O, E>(
79+
&self,
80+
request: &XrpcRequest<P, I>,
81+
) -> impl Future<Output = XrpcResult<O, E>>
6682
where
6783
P: Serialize + Send + Sync,
6884
I: Serialize + Send + Sync,
@@ -72,7 +88,10 @@ pub trait XrpcClient: HttpClient {
7288
send_xrpc(self, request)
7389
}
7490
#[cfg(not(target_arch = "wasm32"))]
75-
fn send_xrpc<P, I, O, E>(&self, request: &XrpcRequest<P, I>) -> impl Future<Output = XrpcResult<O, E>> + Send
91+
fn send_xrpc<P, I, O, E>(
92+
&self,
93+
request: &XrpcRequest<P, I>,
94+
) -> impl Future<Output = XrpcResult<O, E>> + Send
7695
where
7796
P: Serialize + Send + Sync,
7897
I: Serialize + Send + Sync,
@@ -85,7 +104,10 @@ pub trait XrpcClient: HttpClient {
85104
}
86105

87106
#[inline(always)]
88-
async fn send_xrpc<P, I, O, E, C: XrpcClient + ?Sized>(client: &C, request: &XrpcRequest<P, I>) -> XrpcResult<O, E>
107+
async fn send_xrpc<P, I, O, E, C: XrpcClient + ?Sized>(
108+
client: &C,
109+
request: &XrpcRequest<P, I>,
110+
) -> XrpcResult<O, E>
89111
where
90112
P: Serialize + Send + Sync,
91113
I: Serialize + Send + Sync,
@@ -148,4 +170,4 @@ where
148170
error: serde_json::from_slice::<XrpcErrorKind<E>>(&body).ok(),
149171
}))
150172
}
151-
}
173+
}

bsky-sdk/src/agent/config.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ pub trait Loader {
5151
/// Loads the configuration data.
5252
fn load(
5353
&self,
54-
) -> impl Future<Output = core::result::Result<Config, Box<dyn std::error::Error + Send + Sync + 'static>>> + Send;
54+
) -> impl Future<
55+
Output = core::result::Result<Config, Box<dyn std::error::Error + Send + Sync + 'static>>,
56+
> + Send;
5557
}
5658

5759
/// The trait for saving configuration data.
@@ -60,5 +62,7 @@ pub trait Saver {
6062
fn save(
6163
&self,
6264
config: &Config,
63-
) -> impl Future<Output = core::result::Result<(), Box<dyn std::error::Error + Send + Sync + 'static>>> + Send;
65+
) -> impl Future<
66+
Output = core::result::Result<(), Box<dyn std::error::Error + Send + Sync + 'static>>,
67+
> + Send;
6468
}

bsky-sdk/src/record.rs

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,45 @@ where
3030
limit: Option<LimitedNonZeroU8<100u8>>,
3131
) -> impl Future<Output = Result<list_records::Output>> + Send;
3232
#[cfg(target_arch = "wasm32")]
33-
fn get(agent: &BskyAgent<T, S>, rkey: String) -> impl Future<Output = Result<get_record::Output>>;
33+
fn get(
34+
agent: &BskyAgent<T, S>,
35+
rkey: String,
36+
) -> impl Future<Output = Result<get_record::Output>>;
3437
#[cfg(not(target_arch = "wasm32"))]
35-
fn get(agent: &BskyAgent<T, S>, rkey: String) -> impl Future<Output = Result<get_record::Output>> + Send;
38+
fn get(
39+
agent: &BskyAgent<T, S>,
40+
rkey: String,
41+
) -> impl Future<Output = Result<get_record::Output>> + Send;
3642
#[cfg(target_arch = "wasm32")]
37-
fn put(self, agent: &BskyAgent<T, S>, rkey: String) -> impl Future<Output = Result<put_record::Output>>;
43+
fn put(
44+
self,
45+
agent: &BskyAgent<T, S>,
46+
rkey: String,
47+
) -> impl Future<Output = Result<put_record::Output>>;
3848
#[cfg(not(target_arch = "wasm32"))]
39-
fn put(self, agent: &BskyAgent<T, S>, rkey: String) -> impl Future<Output = Result<put_record::Output>> + Send;
49+
fn put(
50+
self,
51+
agent: &BskyAgent<T, S>,
52+
rkey: String,
53+
) -> impl Future<Output = Result<put_record::Output>> + Send;
4054
#[cfg(target_arch = "wasm32")]
41-
fn create(self, agent: &BskyAgent<T, S>) -> impl Future<Output = Result<create_record::Output>>;
55+
fn create(self, agent: &BskyAgent<T, S>)
56+
-> impl Future<Output = Result<create_record::Output>>;
4257
#[cfg(not(target_arch = "wasm32"))]
43-
fn create(self, agent: &BskyAgent<T, S>) -> impl Future<Output = Result<create_record::Output>> + Send;
58+
fn create(
59+
self,
60+
agent: &BskyAgent<T, S>,
61+
) -> impl Future<Output = Result<create_record::Output>> + Send;
4462
#[cfg(target_arch = "wasm32")]
45-
fn delete(agent: &BskyAgent<T, S>, rkey: String) -> impl Future<Output = Result<delete_record::Output>>;
63+
fn delete(
64+
agent: &BskyAgent<T, S>,
65+
rkey: String,
66+
) -> impl Future<Output = Result<delete_record::Output>>;
4667
#[cfg(not(target_arch = "wasm32"))]
47-
fn delete(agent: &BskyAgent<T, S>, rkey: String) -> impl Future<Output = Result<delete_record::Output>> + Send;
68+
fn delete(
69+
agent: &BskyAgent<T, S>,
70+
rkey: String,
71+
) -> impl Future<Output = Result<delete_record::Output>> + Send;
4872
}
4973

5074
macro_rules! record_impl {

0 commit comments

Comments
 (0)