reformat imports

This commit is contained in:
Aiden McClelland
2021-04-07 21:57:02 -06:00
parent dd22dfacc2
commit 64d5d40765
10 changed files with 48 additions and 34 deletions

View File

@@ -1,14 +1,14 @@
use super::parse::*;
use super::*;
use std::collections::HashSet;
use proc_macro2::*;
use quote::*;
use std::collections::HashSet;
use syn::{
fold::Fold,
punctuated::Punctuated,
spanned::Spanned,
token::{Comma, Where},
};
use syn::fold::Fold;
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::token::{Comma, Where};
use super::parse::*;
use super::*;
fn build_app(name: LitStr, opt: &mut Options, params: &mut [ParamType]) -> TokenStream {
let about = opt.common().about.clone().into_iter();

View File

@@ -1,6 +1,7 @@
use super::*;
use syn::spanned::Spanned;
use super::*;
pub fn parse_command_attr(args: AttributeArgs) -> Result<Options> {
let mut opt = Options::Leaf(Default::default());
for arg in args {

View File

@@ -15,4 +15,4 @@ pub use command::build::build as build_command;
pub use rpc_server::build::build as build_rpc_server;
pub use rpc_server::RpcServerArgs;
pub use run_cli::build::build as build_run_cli;
pub use run_cli::RunCliArgs;
pub use run_cli::RunCliArgs;

View File

@@ -1,8 +1,9 @@
use super::*;
use proc_macro2::TokenStream;
use quote::quote;
use syn::spanned::Spanned;
use super::*;
pub fn build(args: RpcServerArgs) -> TokenStream {
let mut command = args.command;
let arguments = std::mem::replace(

View File

@@ -1,6 +1,7 @@
use super::*;
use syn::parse::{Parse, ParseStream};
use super::*;
impl Parse for RpcServerArgs {
fn parse(input: ParseStream) -> Result<Self> {
let command = input.parse()?;

View File

@@ -1,8 +1,9 @@
use super::*;
use proc_macro2::TokenStream;
use quote::quote;
use syn::spanned::Spanned;
use super::*;
pub fn build(args: RunCliArgs) -> TokenStream {
let mut command_handler = args.command.clone();
let mut arguments = std::mem::replace(

View File

@@ -1,6 +1,7 @@
use super::*;
use syn::parse::{Parse, ParseStream};
use super::*;
impl Parse for MakeSeed {
fn parse(input: ParseStream) -> Result<Self> {
let matches_ident = input.parse()?;

View File

@@ -1,5 +1,7 @@
use std::fmt::Display;
use std::io::Stdin;
use std::marker::PhantomData;
use std::str::FromStr;
use std::{fmt::Display, io::Stdin, marker::PhantomData};
use clap::ArgMatches;
use hyper::Method;
@@ -10,18 +12,21 @@ use yajrc::{GenericRpcMethod, Id, RpcError, RpcRequest, RpcResponse};
use crate::Context;
pub mod prelude {
pub use std::borrow::Cow;
pub use std::marker::PhantomData;
pub use clap::{App, AppSettings, Arg, ArgMatches};
pub use serde::{Deserialize, Serialize};
pub use serde_json::{from_value, to_value, Value};
pub use tokio::runtime::Runtime;
pub use tokio::task::spawn_blocking;
pub use yajrc::{self, RpcError};
pub use super::{
call_remote, default_arg_parser, default_display, default_stdin_parser, make_phantom,
match_types,
};
pub use crate::Context;
pub use clap::{App, AppSettings, Arg, ArgMatches};
pub use serde::{Deserialize, Serialize};
pub use serde_json::{from_value, to_value, Value};
pub use std::borrow::Cow;
pub use std::marker::PhantomData;
pub use tokio::{runtime::Runtime, task::spawn_blocking};
pub use yajrc::{self, RpcError};
}
#[derive(Debug, Error)]

View File

@@ -1,17 +1,17 @@
use std::marker::PhantomData;
use crate::SeedableContext;
use hyper::{
body::Buf,
server::{conn::AddrIncoming, Builder, Server},
Body, Request, Response, StatusCode,
};
use hyper::body::Buf;
use hyper::server::conn::AddrIncoming;
use hyper::server::{Builder, Server};
use hyper::{Body, Request, Response, StatusCode};
use lazy_static::lazy_static;
use serde::Deserialize;
use serde_json::Value;
use url::Host;
use yajrc::{AnyRpcMethod, GenericRpcMethod, Id, RpcError, RpcRequest, RpcResponse};
use crate::SeedableContext;
lazy_static! {
#[cfg(feature = "cbor")]
static ref CBOR_INTERNAL_ERROR: Vec<u8> =

View File

@@ -1,13 +1,16 @@
pub use crate as rpc_toolkit;
use crate::{command, rpc_server, Context, SeedableContext};
use std::fmt::Display;
use std::str::FromStr;
use std::sync::Arc;
use clap::Arg;
use rpc_toolkit_macro::run_cli;
use serde::{Deserialize, Serialize};
use std::str::FromStr;
use std::{fmt::Display, sync::Arc};
use url::Host;
use yajrc::RpcError;
pub use crate as rpc_toolkit;
use crate::{command, rpc_server, Context, SeedableContext};
pub struct AppState<T, U> {
seed: T,
data: U,
@@ -93,9 +96,10 @@ fn dothething2<U: Serialize + for<'a> Deserialize<'a> + FromStr<Err = E>, E: Dis
#[tokio::test]
async fn test() {
use crate as rpc_toolkit;
use tokio::io::AsyncWriteExt;
use crate as rpc_toolkit;
let seed = Arc::new(ConfigSeed {
host: Host::parse("localhost").unwrap(),
port: 8000,