Skip to content

Commit b0c92a1

Browse files
committed
Fix rustfmt issues
1 parent b09e872 commit b0c92a1

File tree

105 files changed

+153
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+153
-154
lines changed

src/api/form.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::{collections::HashMap, error::Error, fmt, fmt::Formatter};
22

33
use mime::Mime;
44
use reqwest::{
5-
multipart::{Form as MultipartForm, Part},
65
Body,
76
Error as ReqwestError,
7+
multipart::{Form as MultipartForm, Part},
88
};
99
use tokio::io::AsyncRead;
1010
use tokio_util::codec::{BytesCodec, FramedRead};

src/handler/longpoll.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use futures_util::{pin_mut, stream::StreamExt};
55
use log::error;
66
use tokio::{
77
spawn,
8-
sync::mpsc::{channel, Receiver, Sender},
8+
sync::mpsc::{Receiver, Sender, channel},
99
time::sleep,
1010
};
1111

@@ -127,11 +127,10 @@ impl LongPollHandle {
127127
}
128128

129129
fn get_error_timeout(err: ExecuteError, default_timeout: Duration) -> Duration {
130-
match err { ExecuteError::Response(err) => {
131-
err.retry_after().map(Duration::from_secs).unwrap_or(default_timeout)
132-
} _ => {
133-
default_timeout
134-
}}
130+
match err {
131+
ExecuteError::Response(err) => err.retry_after().map(Duration::from_secs).unwrap_or(default_timeout),
132+
_ => default_timeout,
133+
}
135134
}
136135

137136
/// Represents options for configuring long polling behavior.

src/types/background/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::types::{tests::assert_json_eq, BackgroundFill, BackgroundType, Document};
1+
use crate::types::{BackgroundFill, BackgroundType, Document, tests::assert_json_eq};
22

33
#[test]
44
fn background_fill() {

src/types/bot/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
2-
api::{assert_payload_eq, Payload},
2+
api::{Payload, assert_payload_eq},
33
types::{
4-
tests::assert_json_eq,
54
Bot,
65
BotCommand,
76
BotCommandScope,
@@ -23,6 +22,7 @@ use crate::{
2322
SetBotDescription,
2423
SetBotName,
2524
SetBotShortDescription,
25+
tests::assert_json_eq,
2626
},
2727
};
2828

src/types/business/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
2-
api::{assert_payload_eq, Payload},
2+
api::{Payload, assert_payload_eq},
33
types::{
4-
tests::assert_json_eq,
54
BusinessConnection,
65
BusinessIntro,
76
BusinessLocation,
@@ -13,6 +12,7 @@ use crate::{
1312
Sticker,
1413
StickerType,
1514
User,
15+
tests::assert_json_eq,
1616
},
1717
};
1818

src/types/callback/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{error::Error, fmt};
22

3-
use serde::{de::DeserializeOwned, Deserialize, Serialize};
3+
use serde::{Deserialize, Serialize, de::DeserializeOwned};
44
use serde_json::Error as JsonError;
55

66
use crate::{

src/types/callback/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use serde::Deserialize;
22

33
use crate::{
4-
api::{assert_payload_eq, Payload},
4+
api::{Payload, assert_payload_eq},
55
types::{
6-
tests::assert_json_eq,
76
AnswerCallbackQuery,
87
CallbackQuery,
98
MaybeInaccessibleMessage,
@@ -12,6 +11,7 @@ use crate::{
1211
SupergroupChat,
1312
Text,
1413
User,
14+
tests::assert_json_eq,
1515
},
1616
};
1717

src/types/chat/action/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
2-
api::{assert_payload_eq, Payload},
3-
types::{tests::assert_json_eq, ChatAction, SendChatAction},
2+
api::{Payload, assert_payload_eq},
3+
types::{ChatAction, SendChatAction, tests::assert_json_eq},
44
};
55

66
#[test]

src/types/chat/boost/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
2-
api::{assert_payload_eq, Payload},
2+
api::{Payload, assert_payload_eq},
33
types::{
4-
tests::assert_json_eq,
54
ChannelChat,
65
ChatBoost,
76
ChatBoostRemoved,
@@ -11,6 +10,7 @@ use crate::{
1110
GetUserChatBoosts,
1211
User,
1312
UserChatBoosts,
13+
tests::assert_json_eq,
1414
},
1515
};
1616

src/types/chat/full_info/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::types::{
2-
tests::assert_json_eq,
32
AccentColor,
43
Birthdate,
54
BusinessIntro,
@@ -22,6 +21,7 @@ use crate::types::{
2221
SupergroupChat,
2322
Text,
2423
User,
24+
tests::assert_json_eq,
2525
};
2626

2727
fn create_chat_full_info(chat_type: ChatFullInfoType) -> ChatFullInfo {

0 commit comments

Comments
 (0)