Apply formatting again

pull/191/head
Chip Senkbeil 1 year ago
parent 2cc596e6dc
commit ec01a60984
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -9,6 +9,5 @@ pub use methods::*;
#[cfg(any(test, feature = "tests"))]
pub mod tests {
pub use crate::TestAuthHandler;
pub use crate::TestAuthenticator;
pub use crate::{TestAuthHandler, TestAuthenticator};
}

@ -121,10 +121,10 @@ pub trait AuthenticationMethod: Send + Sync {
#[cfg(test)]
mod tests {
use std::sync::mpsc;
use test_log::test;
use super::*;
use crate::authenticator::TestAuthenticator;
struct SuccessAuthenticationMethod;

@ -5,9 +5,8 @@ use distant_net::client::Mailbox;
use distant_net::common::{Request, Response};
use log::*;
use tokio::io;
use tokio::sync::mpsc;
use tokio::sync::mpsc::error::{TryRecvError, TrySendError};
use tokio::sync::RwLock;
use tokio::sync::{mpsc, RwLock};
use tokio::task::JoinHandle;
use crate::client::DistantChannel;

@ -12,6 +12,5 @@ mod serde_str;
/// Network functionality.
pub use distant_net as net;
/// Protocol structures.
pub use distant_protocol as protocol;

@ -3,17 +3,16 @@ use std::time::SystemTime;
use std::{env, io};
use async_trait::async_trait;
use ignore::{DirEntry as WalkDirEntry, WalkBuilder};
use log::*;
use tokio::io::AsyncWriteExt;
use walkdir::WalkDir;
use distant_core::protocol::{
Capabilities, ChangeKind, ChangeKindSet, DirEntry, Environment, FileType, Metadata,
Permissions, ProcessId, PtySize, SearchId, SearchQuery, SetPermissionsOptions, SystemInfo,
Version, PROTOCOL_VERSION,
};
use distant_core::{DistantApi, DistantCtx};
use ignore::{DirEntry as WalkDirEntry, WalkBuilder};
use log::*;
use tokio::io::AsyncWriteExt;
use walkdir::WalkDir;
mod process;
@ -702,15 +701,14 @@ mod tests {
use std::time::Duration;
use assert_fs::prelude::*;
use distant_core::net::server::Reply;
use distant_core::net::server::{ConnectionCtx, Reply};
use distant_core::protocol::Response;
use once_cell::sync::Lazy;
use predicates::prelude::*;
use test_log::test;
use tokio::sync::mpsc;
use super::*;
use distant_core::net::server::ConnectionCtx;
use distant_core::protocol::Response;
static TEMP_SCRIPT_DIR: Lazy<assert_fs::TempDir> =
Lazy::new(|| assert_fs::TempDir::new().unwrap());

@ -1,11 +1,10 @@
use std::future::Future;
use std::pin::Pin;
use distant_core::protocol::{ProcessId, PtySize};
use tokio::io;
use tokio::sync::mpsc;
use distant_core::protocol::{ProcessId, PtySize};
mod pty;
pub use pty::*;

@ -2,6 +2,7 @@ use std::ffi::OsStr;
use std::path::PathBuf;
use std::process::Stdio;
use distant_core::protocol::Environment;
use log::*;
use tokio::io;
use tokio::process::Command;
@ -12,7 +13,6 @@ use super::{
wait, ExitStatus, FutureReturn, InputChannel, NoProcessPty, OutputChannel, Process, ProcessId,
ProcessKiller, WaitRx,
};
use distant_core::protocol::Environment;
mod tasks;

@ -806,10 +806,10 @@ mod tests {
use std::path::PathBuf;
use assert_fs::prelude::*;
use distant_core::protocol::{FileType, SearchQueryCondition, SearchQueryMatchData};
use test_log::test;
use super::*;
use distant_core::protocol::{FileType, SearchQueryCondition, SearchQueryMatchData};
fn make_path(path: &str) -> PathBuf {
use std::path::MAIN_SEPARATOR;

@ -11,9 +11,8 @@ use notify::{
Config as WatcherConfig, Error as WatcherError, ErrorKind as WatcherErrorKind,
Event as WatcherEvent, EventKind, PollWatcher, RecursiveMode, Watcher,
};
use tokio::sync::mpsc;
use tokio::sync::mpsc::error::TrySendError;
use tokio::sync::oneshot;
use tokio::sync::{mpsc, oneshot};
use tokio::task::JoinHandle;
use crate::constants::SERVER_WATCHER_CAPACITY;

@ -1,7 +1,6 @@
mod api;
mod constants;
pub use api::LocalDistantApi;
use distant_core::{DistantApi, DistantApiServerHandler};
/// Implementation of [`DistantApiServerHandler`] using [`LocalDistantApi`].
@ -14,4 +13,3 @@ pub fn initialize_handler() -> std::io::Result<LocalDistantApiServerHandler> {
LocalDistantApi::initialize()?,
))
}

@ -1,10 +1,11 @@
use crate::common::utils;
use crate::common::{FramedTransport, Transport};
use std::io;
use async_trait::async_trait;
use distant_auth::msg::*;
use distant_auth::{AuthHandler, Authenticate, Authenticator};
use log::*;
use std::io;
use crate::common::{utils, FramedTransport, Transport};
macro_rules! write_frame {
($transport:expr, $data:expr) => {{

@ -9,8 +9,7 @@ use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use super::{InmemoryTransport, Interest, Ready, Reconnectable, Transport};
use crate::common::utils;
use crate::common::SecretKey32;
use crate::common::{utils, SecretKey32};
mod backup;
mod codec;

@ -5,8 +5,7 @@ pub mod manager;
pub mod server;
pub use client::{Client, ReconnectStrategy};
pub use server::Server;
pub use {log, paste};
/// Authentication functionality tied to network operations.
pub use distant_auth as auth;
pub use server::Server;
pub use {log, paste};

@ -96,6 +96,7 @@ impl Permissions {
other_exec: None,
}
}
/// Creates a set of [`Permissions`] that indicate globally writable status.
///
/// ```

@ -612,9 +612,10 @@ mod tests {
}
mod changed {
use std::path::PathBuf;
use super::*;
use crate::common::ChangeKind;
use std::path::PathBuf;
#[test]
fn should_be_able_to_serialize_to_json() {
@ -742,9 +743,10 @@ mod tests {
}
mod metadata {
use std::path::PathBuf;
use super::*;
use crate::common::{FileType, UnixMetadata, WindowsMetadata};
use std::path::PathBuf;
#[test]
fn should_be_able_to_serialize_minimal_payload_to_json() {
@ -1219,9 +1221,10 @@ mod tests {
}
mod search_results {
use std::path::PathBuf;
use super::*;
use crate::common::{SearchQueryContentsMatch, SearchQueryMatch, SearchQuerySubmatch};
use std::path::PathBuf;
#[test]
fn should_be_able_to_serialize_to_json() {
@ -1768,9 +1771,10 @@ mod tests {
}
mod system_info {
use super::*;
use std::path::PathBuf;
use super::*;
#[test]
fn should_be_able_to_serialize_to_json() {
let payload = Response::SystemInfo(SystemInfo {

@ -3,9 +3,10 @@ use ::predicates::prelude::*;
mod predicates;
mod reader;
pub use self::predicates::TrimmedLinesMatchPredicate;
pub use reader::ThreadedReader;
pub use self::predicates::TrimmedLinesMatchPredicate;
/// Produces a regex predicate using the given string
pub fn regex_pred(s: &str) -> ::predicates::str::RegexPredicate {
predicate::str::is_match(s).unwrap()

@ -1,6 +1,7 @@
use std::fmt;
use predicates::reflection::PredicateReflection;
use predicates::Predicate;
use std::fmt;
/// Checks if lines of text match the provided, trimming each line
/// of both before comparing.

Loading…
Cancel
Save