Skip to content

Commit 77e24b8

Browse files
committed
Reformat
1 parent 884fe70 commit 77e24b8

File tree

6 files changed

+38
-22
lines changed

6 files changed

+38
-22
lines changed

rustfmt.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports_granularity = "Module"
2+
group_imports = "StdExternalCrate"

src/api.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
use std::{collections::HashMap, num::NonZeroU16, sync::Arc};
1+
use std::collections::HashMap;
2+
use std::num::NonZeroU16;
3+
use std::sync::Arc;
24

35
use reqwest::Url;
4-
use serde::{de::DeserializeOwned, Deserialize};
6+
use serde::de::DeserializeOwned;
7+
use serde::Deserialize;
58
use serde_json::Value;
69

7-
use crate::{
8-
req::{self, Login, Main, QueryProp, RvProp, RvSlot, TokenType, QueryPropRevisions},
9-
BotPassword, Result, Simple, WriteUrlParams,
10-
};
10+
use crate::req::{self, Login, Main, QueryProp, QueryPropRevisions, RvProp, RvSlot, TokenType};
11+
use crate::{BotPassword, Result, Simple, WriteUrlParams};
1112

1213
#[derive(Deserialize, Debug)]
1314
pub struct Slot {

src/gen.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use std::{pin::Pin, task::{Context, Poll}};
1+
use std::pin::Pin;
2+
use std::task::{Context, Poll};
23

34
use futures_core::Stream;
45

6+
use crate::req::{Main, Query};
57
use crate::{Bot, Page};
68

79
pub struct SearchGenerator {
@@ -18,7 +20,9 @@ impl SearchGenerator {
1820
impl Stream for SearchGenerator {
1921
type Item = Page;
2022
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
23+
let m = Main::query(Query {
24+
..Default::default()
25+
});
2126
todo!()
2227
}
2328
}
24-

src/lib.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
use std::{borrow::Cow, convert::Infallible, num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroUsize}, ops::Deref, sync::Arc};
1+
use std::borrow::Cow;
2+
use std::convert::Infallible;
3+
use std::num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroUsize};
4+
use std::ops::Deref;
5+
use std::sync::Arc;
26

37
use req::{encode_multivalue, HasValue};
4-
use reqwest::{
5-
header::{HeaderMap, HeaderValue},
6-
Client, Url,
7-
};
8+
use reqwest::header::{HeaderMap, HeaderValue};
9+
use reqwest::{Client, Url};
810
use serde::Deserialize;
911

1012
pub mod api;
11-
pub mod req;
1213
pub mod gen;
14+
pub mod req;
1315

1416
pub trait WriteUrlParams {
1517
fn ser<W: UrlParamWriter>(&self, w: &mut W) -> Result<(), W::E>;

src/req.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use std::{collections::HashSet, fmt::Debug, hash::Hash, mem::discriminant, num::{NonZeroU16, NonZeroU32}};
1+
use std::collections::HashSet;
2+
use std::fmt::Debug;
3+
use std::hash::Hash;
4+
use std::mem::discriminant;
5+
use std::num::{NonZeroU16, NonZeroU32};
26

37
use bytemuck::TransparentWrapper;
48
use serde::ser::SerializeSeq;

wikiproc/src/lib.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use proc_macro2::TokenStream as Ts;
22
use quote::quote;
3-
use syn::{spanned::Spanned, Data, Fields, FieldsUnnamed, Lit, Meta, MetaNameValue, NestedMeta};
3+
use syn::spanned::Spanned;
4+
use syn::{Data, Fields, FieldsUnnamed, Lit, Meta, MetaNameValue, NestedMeta};
45
use synstructure::VariantInfo;
56

67
synstructure::decl_derive!([WriteUrl, attributes(wikiproc)] => derive_write_url);
@@ -97,12 +98,14 @@ fn gen_fields(v: &VariantInfo, o: &Options) -> Ts {
9798
} else {
9899
let name = opts.override_name.unwrap_or_else(|| {
99100
let mut s = o.prepend_all.clone().unwrap_or_default();
100-
s.push_str(&*b.ast()
101-
.ident
102-
.as_ref()
103-
.unwrap()
104-
.to_string()
105-
.to_ascii_lowercase());
101+
s.push_str(
102+
&*b.ast()
103+
.ident
104+
.as_ref()
105+
.unwrap()
106+
.to_string()
107+
.to_ascii_lowercase(),
108+
);
106109
s
107110
});
108111
quote! {{

0 commit comments

Comments
 (0)