Skip to content

Commit d621ae8

Browse files
committed
fix: formatting
1 parent 927bce9 commit d621ae8

File tree

9 files changed

+19
-22
lines changed

9 files changed

+19
-22
lines changed

couch_rs/examples/basic_operations/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// automatically assigned IP address. Minikube for example generates a unique IP on start-up. You
1313
/// can obtain it with: `minikube ip`
1414
use couch_rs::types::find::FindQuery;
15-
use serde_json::{json, Value};
15+
use serde_json::{Value, json};
1616
use std::error::Error;
1717

1818
const TEST_DB: &str = "test_db";

couch_rs/examples/typed_documents/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(clippy::pub_underscore_fields)]
22
#![allow(clippy::used_underscore_binding)]
33

4-
use couch_rs::{document::TypedCouchDocument, types::document::DocumentId, CouchDocument};
4+
use couch_rs::{CouchDocument, document::TypedCouchDocument, types::document::DocumentId};
55
use serde::{Deserialize, Serialize};
66

77
const TEST_DB: &str = "test_db";

couch_rs/src/changes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
types::changes::{ChangeEvent, Event},
55
};
66
use futures_core::{Future, Stream};
7-
use futures_util::{ready, FutureExt, StreamExt, TryStreamExt};
7+
use futures_util::{FutureExt, StreamExt, TryStreamExt, ready};
88
use reqwest::{Method, Response, StatusCode};
99
use std::{
1010
collections::HashMap,
@@ -36,8 +36,8 @@ pub struct ChangesStream {
3636

3737
enum ChangesStreamState {
3838
Idle,
39-
Requesting(Pin<Box<dyn Future<Output=CouchResult<Response>> + Send + Sync + 'static>>),
40-
Reading(Pin<Box<dyn Stream<Item=io::Result<String>> + Send + Sync + 'static>>),
39+
Requesting(Pin<Box<dyn Future<Output = CouchResult<Response>> + Send + Sync + 'static>>),
40+
Reading(Pin<Box<dyn Stream<Item = io::Result<String>> + Send + Sync + 'static>>),
4141
}
4242

4343
impl ChangesStream {
@@ -186,7 +186,7 @@ impl Stream for ChangesStream {
186186
mod tests {
187187
use crate::client::Client;
188188
use futures_util::StreamExt;
189-
use serde_json::{json, Value};
189+
use serde_json::{Value, json};
190190
use tokio::join;
191191

192192
#[tokio::test]

couch_rs/src/document.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use serde::{de::DeserializeOwned, Deserialize, Serialize};
1+
use serde::{Deserialize, Serialize, de::DeserializeOwned};
22
use serde_json::Value;
33
use std::{
44
borrow::Cow,

couch_rs/src/lib.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ mod macros {
168168

169169
/// Gets milliseconds from timespec
170170
macro_rules! tspec_ms {
171-
($tspec:ident) => {{
172-
$tspec.sec * 1000 + $tspec.nsec as i64 / 1000000
173-
}};
171+
($tspec:ident) => {{ $tspec.sec * 1000 + $tspec.nsec as i64 / 1000000 }};
174172
}
175173

176174
/// Gets current UNIX time in milliseconds
@@ -183,9 +181,7 @@ mod macros {
183181

184182
/// Url encode path segments
185183
macro_rules! url_encode {
186-
($id:ident) => {{
187-
url::form_urlencoded::byte_serialize($id.as_bytes()).collect::<String>()
188-
}};
184+
($id:ident) => {{ url::form_urlencoded::byte_serialize($id.as_bytes()).collect::<String>() }};
189185
}
190186
}
191187

@@ -217,7 +213,7 @@ pub use client::Client;
217213
#[cfg(test)]
218214
mod couch_rs_tests {
219215
use crate as couch_rs;
220-
use couch_rs::{document::TypedCouchDocument, types::document::DocumentId, CouchDocument};
216+
use couch_rs::{CouchDocument, document::TypedCouchDocument, types::document::DocumentId};
221217
use serde::{Deserialize, Serialize};
222218
use std::borrow::Cow;
223219

@@ -574,7 +570,7 @@ mod couch_rs_tests {
574570
view::{CouchFunc, CouchViews, ViewCollection},
575571
},
576572
};
577-
use serde_json::{json, Value};
573+
use serde_json::{Value, json};
578574
use tokio::sync::{
579575
mpsc,
580576
mpsc::{Receiver, Sender},
@@ -1116,13 +1112,14 @@ mod couch_rs_tests {
11161112
11171113
this will fail to deserialize if ViewItem.key is a String. It needs to be a Value to cover for all json scenarios
11181114
*/
1119-
assert!(db
1120-
.create_view(
1115+
assert!(
1116+
db.create_view(
11211117
view_name,
11221118
CouchViews::new(view_name, CouchFunc::new(count_by_id, Some("_count"))),
11231119
)
11241120
.await
1125-
.is_ok());
1121+
.is_ok()
1122+
);
11261123

11271124
assert!(db.query_raw(view_name, view_name, None).await.is_ok());
11281125

couch_rs/src/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::document::TypedCouchDocument;
22
use serde::ser::Serialize;
3-
use serde_json::{from_value, to_value, Value};
3+
use serde_json::{Value, from_value, to_value};
44

55
/// Trait that provides methods that can be used to switch between abstract `Value` and concrete `Model` implementors (such as your custom data models)
66
pub trait Model<T: TypedCouchDocument> {

couch_rs/src/typed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{
1313
view::ViewCollection,
1414
},
1515
};
16-
use serde::{de::DeserializeOwned, Serialize};
16+
use serde::{Serialize, de::DeserializeOwned};
1717
use serde_json::Value;
1818
use std::marker::PhantomData;
1919
use tokio::sync::mpsc::Sender;

couch_rs/src/types/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::document::DocumentId;
22
use crate::{document::TypedCouchDocument, types::view::ViewCollection};
3-
use serde::{de::DeserializeOwned, Deserialize, Serialize};
3+
use serde::{Deserialize, Serialize, de::DeserializeOwned};
44

55
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)]
66
pub struct QueriesParams {

couch_rs/src/types/view.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::document::TypedCouchDocument;
2-
use serde::{de::DeserializeOwned, Deserialize, Serialize};
2+
use serde::{Deserialize, Serialize, de::DeserializeOwned};
33
use serde_json::Value;
44
use std::{collections::HashMap, string::ToString};
55

0 commit comments

Comments
 (0)