Apply formatting again

pull/206/head
Chip Senkbeil 12 months ago
parent 3d8476f999
commit 6df19dfd9d
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -31,9 +31,10 @@ async fn setup(api: impl DistantApi + Send + Sync + 'static) -> (DistantClient,
} }
mod single { mod single {
use super::*;
use test_log::test; use test_log::test;
use super::*;
#[test(tokio::test)] #[test(tokio::test)]
async fn should_support_single_request_returning_error() { async fn should_support_single_request_returning_error() {
struct TestDistantApi; struct TestDistantApi;
@ -71,12 +72,14 @@ mod single {
} }
mod batch_parallel { mod batch_parallel {
use super::*; use std::time::{Duration, SystemTime, UNIX_EPOCH};
use distant_net::common::Request; use distant_net::common::Request;
use distant_protocol::{Msg, Request as RequestPayload}; use distant_protocol::{Msg, Request as RequestPayload};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use test_log::test; use test_log::test;
use super::*;
#[test(tokio::test)] #[test(tokio::test)]
async fn should_support_multiple_requests_running_in_parallel() { async fn should_support_multiple_requests_running_in_parallel() {
struct TestDistantApi; struct TestDistantApi;
@ -185,12 +188,14 @@ mod batch_parallel {
} }
mod batch_sequence { mod batch_sequence {
use super::*; use std::time::{Duration, SystemTime, UNIX_EPOCH};
use distant_net::common::Request; use distant_net::common::Request;
use distant_protocol::{Msg, Request as RequestPayload}; use distant_protocol::{Msg, Request as RequestPayload};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use test_log::test; use test_log::test;
use super::*;
#[test(tokio::test)] #[test(tokio::test)]
async fn should_support_multiple_requests_running_in_sequence() { async fn should_support_multiple_requests_running_in_sequence() {
struct TestDistantApi; struct TestDistantApi;

@ -3,13 +3,13 @@ mod request;
mod response; mod response;
mod value; mod value;
use std::io::Cursor;
pub use header::*; pub use header::*;
pub use request::*; pub use request::*;
pub use response::*; pub use response::*;
pub use value::*; pub use value::*;
use std::io::Cursor;
/// Represents a generic id type /// Represents a generic id type
pub type Id = String; pub type Id = String;
@ -257,9 +257,10 @@ mod tests {
use super::*; use super::*;
mod read_str_bytes { mod read_str_bytes {
use super::*;
use test_log::test; use test_log::test;
use super::*;
#[test] #[test]
fn should_fail_if_input_is_empty() { fn should_fail_if_input_is_empty() {
let input = read_str_bytes(&[]).unwrap_err(); let input = read_str_bytes(&[]).unwrap_err();
@ -282,9 +283,10 @@ mod tests {
} }
mod read_key_eq { mod read_key_eq {
use super::*;
use test_log::test; use test_log::test;
use super::*;
#[test] #[test]
fn should_fail_if_input_is_empty() { fn should_fail_if_input_is_empty() {
let input = read_key_eq(&[], "key").unwrap_err(); let input = read_key_eq(&[], "key").unwrap_err();
@ -338,9 +340,10 @@ mod tests {
} }
mod read_header_bytes { mod read_header_bytes {
use super::*;
use test_log::test; use test_log::test;
use super::*;
#[test] #[test]
fn should_fail_if_input_is_empty() { fn should_fail_if_input_is_empty() {
let input = vec![]; let input = vec![];
@ -527,9 +530,10 @@ mod tests {
} }
mod find_msgpack_byte_len { mod find_msgpack_byte_len {
use super::*;
use test_log::test; use test_log::test;
use super::*;
#[test] #[test]
fn should_return_none_if_input_is_empty() { fn should_return_none_if_input_is_empty() {
let input = vec![]; let input = vec![];

@ -1,11 +1,12 @@
use crate::common::{utils, Value}; use std::collections::HashMap;
use std::ops::{Deref, DerefMut};
use std::{fmt, io};
use derive_more::IntoIterator; use derive_more::IntoIterator;
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::fmt; use crate::common::{utils, Value};
use std::io;
use std::ops::{Deref, DerefMut};
/// Generates a new [`Header`] of key/value pairs based on literals. /// Generates a new [`Header`] of key/value pairs based on literals.
/// ///

@ -1,10 +1,12 @@
use crate::common::utils;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use std::borrow::Cow; use std::borrow::Cow;
use std::io; use std::io;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use crate::common::utils;
/// Generic value type for data passed through header. /// Generic value type for data passed through header.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)] #[serde(transparent)]

@ -1,6 +1,5 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::fmt; use std::{fmt, io};
use std::io;
use log::*; use log::*;
use tokio::sync::mpsc; use tokio::sync::mpsc;

@ -1,6 +1,7 @@
use std::fmt;
use super::ServerReply; use super::ServerReply;
use crate::common::{ConnectionId, Request}; use crate::common::{ConnectionId, Request};
use std::fmt;
/// Represents contextual information for working with an inbound request. /// Represents contextual information for working with an inbound request.
pub struct RequestCtx<T, U> { pub struct RequestCtx<T, U> {

@ -3,6 +3,7 @@ use std::net::IpAddr;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use tokio::task::JoinError; use tokio::task::JoinError;
use super::ServerRef; use super::ServerRef;

@ -3,6 +3,7 @@ use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use tokio::task::JoinError; use tokio::task::JoinError;
use super::ServerRef; use super::ServerRef;

@ -3,6 +3,7 @@ use std::future::Future;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use tokio::task::JoinError; use tokio::task::JoinError;
use super::ServerRef; use super::ServerRef;

@ -1,19 +1,16 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::io; use std::io;
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::{Path, PathBuf};
use std::path::PathBuf;
use std::time::Duration; use std::time::Duration;
use anyhow::Context; use anyhow::Context;
use distant_core::net::common::{ConnectionId, Host, Map, Request, Response}; use distant_core::net::common::{ConnectionId, Host, Map, Request, Response};
use distant_core::net::manager::ManagerClient; use distant_core::net::manager::ManagerClient;
use distant_core::protocol::SearchQueryContentsMatch;
use distant_core::protocol::SearchQueryMatch;
use distant_core::protocol::SearchQueryPathMatch;
use distant_core::protocol::{ use distant_core::protocol::{
self, Capabilities, ChangeKind, ChangeKindSet, FileType, Permissions, SearchQuery, self, Capabilities, ChangeKind, ChangeKindSet, FileType, Permissions, SearchQuery,
SetPermissionsOptions, SystemInfo, SearchQueryContentsMatch, SearchQueryMatch, SearchQueryPathMatch, SetPermissionsOptions,
SystemInfo,
}; };
use distant_core::{DistantChannel, DistantChannelExt, RemoteCommand, Searcher, Watcher}; use distant_core::{DistantChannel, DistantChannelExt, RemoteCommand, Searcher, Watcher};
use log::*; use log::*;

Loading…
Cancel
Save