Skip to content

Commit dc67ba7

Browse files
committed
fmt with import grouping
1 parent 855e3f9 commit dc67ba7

File tree

20 files changed

+43
-48
lines changed

20 files changed

+43
-48
lines changed

actix-codec/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ mod bcodec;
1616
mod framed;
1717
mod lines;
1818

19-
pub use self::bcodec::BytesCodec;
20-
pub use self::framed::{Framed, FramedParts};
21-
pub use self::lines::LinesCodec;
22-
2319
pub use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
2420
pub use tokio_util::codec::{Decoder, Encoder};
2521
pub use tokio_util::io::poll_read_buf;
22+
23+
pub use self::bcodec::BytesCodec;
24+
pub use self::framed::{Framed, FramedParts};
25+
pub use self::lines::LinesCodec;

actix-codec/tests/test_framed_sink.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
use std::{
2+
collections::VecDeque,
3+
io::{self, Write},
4+
pin::Pin,
5+
task::{
6+
Context,
7+
Poll::{self, Pending, Ready},
8+
},
9+
};
10+
111
use actix_codec::*;
2-
use bytes::Buf;
3-
use bytes::{BufMut, BytesMut};
12+
use bytes::{Buf as _, BufMut as _, BytesMut};
413
use futures_sink::Sink;
5-
use std::collections::VecDeque;
6-
use std::io::{self, Write};
7-
use std::pin::Pin;
8-
use std::task::Poll::{Pending, Ready};
9-
use std::task::{Context, Poll};
1014
use tokio_test::{assert_ready, task};
1115

1216
macro_rules! bilateral {

actix-rt/examples/hyper.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use hyper::service::{make_service_fn, service_fn};
2-
use hyper::{Body, Request, Response, Server};
3-
use std::convert::Infallible;
4-
use std::net::SocketAddr;
1+
use std::{convert::Infallible, net::SocketAddr};
2+
3+
use hyper::{
4+
service::{make_service_fn, service_fn},
5+
Body, Request, Response, Server,
6+
};
57

68
async fn handle(_req: Request<Body>) -> Result<Response<Body>, Infallible> {
79
Ok(Response::new(Body::from("Hello World")))

actix-rt/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,24 @@ compile_error!("io_uring is a linux only feature.");
5151

5252
use std::future::Future;
5353

54-
use tokio::task::JoinHandle;
55-
5654
// Cannot define a main macro when compiled into test harness.
5755
// Workaround for https://github.com/rust-lang/rust/issues/62127.
5856
#[cfg(all(feature = "macros", not(test)))]
5957
pub use actix_macros::main;
60-
6158
#[cfg(feature = "macros")]
6259
pub use actix_macros::test;
6360

6461
mod arbiter;
6562
mod runtime;
6663
mod system;
6764

65+
pub use tokio::pin;
66+
use tokio::task::JoinHandle;
67+
6868
pub use self::arbiter::{Arbiter, ArbiterHandle};
6969
pub use self::runtime::Runtime;
7070
pub use self::system::{System, SystemRunner};
7171

72-
pub use tokio::pin;
73-
7472
pub mod signal {
7573
//! Asynchronous signal handling (Tokio re-exports).
7674
@@ -95,7 +93,6 @@ pub mod net {
9593
use tokio::io::{AsyncRead, AsyncWrite, Interest};
9694
pub use tokio::net::UdpSocket;
9795
pub use tokio::net::{TcpListener, TcpSocket, TcpStream};
98-
9996
#[cfg(unix)]
10097
pub use tokio::net::{UnixDatagram, UnixListener, UnixStream};
10198

actix-rt/tests/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::{
44
};
55

66
use actix_rt::{task::JoinError, Arbiter, System};
7-
87
#[cfg(not(feature = "io-uring"))]
98
use {
109
std::{sync::mpsc::channel, thread},

actix-server/src/join_all.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ impl<T> Future for JoinAll<T> {
6363

6464
#[cfg(test)]
6565
mod test {
66-
use super::*;
67-
6866
use actix_utils::future::ready;
6967

68+
use super::*;
69+
7070
#[actix_rt::test]
7171
async fn test_join_all() {
7272
let futs = vec![ready(Ok(1)), ready(Err(3)), ready(Ok(9))];

actix-server/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ pub use self::builder::ServerBuilder;
2222
pub use self::handle::ServerHandle;
2323
pub use self::server::Server;
2424
pub use self::service::ServerServiceFactory;
25-
pub use self::test_server::TestServer;
26-
2725
#[doc(hidden)]
2826
pub use self::socket::FromStream;
27+
pub use self::test_server::TestServer;
2928

3029
/// Start server building process
3130
#[doc(hidden)]

actix-server/src/socket.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::{fmt, io};
66
use actix_rt::net::TcpStream;
77
pub(crate) use mio::net::TcpListener as MioTcpListener;
88
use mio::{event::Source, Interest, Registry, Token};
9-
109
#[cfg(unix)]
1110
pub(crate) use {
1211
mio::net::UnixListener as MioUnixListener,

actix-service/src/fn_service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,10 @@ mod tests {
394394

395395
#[actix_rt::test]
396396
async fn test_auto_impl_send() {
397-
use crate::{map_config, ServiceExt, ServiceFactoryExt};
398397
use alloc::rc::Rc;
399398

399+
use crate::{map_config, ServiceExt, ServiceFactoryExt};
400+
400401
let srv_1 = fn_service(|_: Rc<u8>| ok::<_, Rc<u8>>(Rc::new(0u8)));
401402

402403
let fac_1 = fn_factory_with_config(|_: Rc<u8>| {

actix-service/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ pub use self::apply_cfg::{apply_cfg, apply_cfg_factory};
3838
pub use self::ext::{ServiceExt, ServiceFactoryExt, TransformExt};
3939
pub use self::fn_service::{fn_factory, fn_factory_with_config, fn_service};
4040
pub use self::map_config::{map_config, unit_config};
41-
pub use self::transform::{apply, ApplyTransform, Transform};
42-
4341
#[allow(unused_imports)]
4442
use self::ready::{err, ok, ready, Ready};
43+
pub use self::transform::{apply, ApplyTransform, Transform};
4544

4645
/// An asynchronous operation from `Request` to a `Response`.
4746
///

0 commit comments

Comments
 (0)