File tree Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ fn to_json() {
6
6
doc. insert ( "first" . to_owned ( ) , Bson :: I32 ( 1 ) ) ;
7
7
doc. insert ( "second" . to_owned ( ) , Bson :: String ( "foo" . to_owned ( ) ) ) ;
8
8
doc. insert ( "alphanumeric" . to_owned ( ) , Bson :: String ( "bar" . to_owned ( ) ) ) ;
9
- let data = Bson :: Document ( doc) . to_json ( ) ;
9
+ let data = Bson :: Document ( doc) . to_json ( ) ;
10
10
11
11
assert ! ( data. is_object( ) ) ;
12
12
let obj = data. as_object ( ) . unwrap ( ) ;
13
-
13
+
14
14
let first = obj. get ( "first" ) . unwrap ( ) ;
15
15
assert ! ( first. is_number( ) ) ;
16
16
assert_eq ! ( first. as_i64( ) . unwrap( ) , 1 ) ;
@@ -22,5 +22,4 @@ fn to_json() {
22
22
let alphanumeric = obj. get ( "alphanumeric" ) . unwrap ( ) ;
23
23
assert ! ( alphanumeric. is_string( ) ) ;
24
24
assert_eq ! ( alphanumeric. as_string( ) . unwrap( ) , "bar" ) ;
25
-
26
25
}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ fn test_encode_array() {
46
46
47
47
assert_eq ! ( & buf[ ..] , & dst[ ..] ) ;
48
48
}
49
+
49
50
#[ test]
50
51
fn test_encode_utc_date_time ( ) {
51
52
let src = UTC . timestamp ( 1286705410 , 0 ) ;
Original file line number Diff line number Diff line change @@ -28,11 +28,9 @@ fn recursive_macro() {
28
28
// Inner Doc 1
29
29
match doc. get ( "b" ) {
30
30
Some ( & Bson :: Document ( ref doc) ) => {
31
-
32
31
// Inner doc 2
33
32
match doc. get ( "bar" ) {
34
33
Some ( & Bson :: Document ( ref inner_doc) ) => {
35
-
36
34
// Inner array
37
35
match inner_doc. get ( "harbor" ) {
38
36
Some ( & Bson :: Array ( ref arr) ) => {
@@ -85,7 +83,6 @@ fn recursive_macro() {
85
83
// Nested document
86
84
match arr[ 0 ] {
87
85
Bson :: Document ( ref doc) => {
88
-
89
86
// String
90
87
match doc. get ( "apple" ) {
91
88
Some ( & Bson :: String ( ref s) ) => assert_eq ! ( "ripe" , s) ,
@@ -101,7 +98,6 @@ fn recursive_macro() {
101
98
// Single-item document
102
99
match doc. get ( "e" ) {
103
100
Some ( & Bson :: Document ( ref bdoc) ) => {
104
-
105
101
// String
106
102
match bdoc. get ( "single" ) {
107
103
Some ( & Bson :: String ( ref s) ) => assert_eq ! ( "test" , s) ,
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ fn remove() {
30
30
let expected_keys = vec ! (
31
31
"first" ,
32
32
"alphanumeric" ,
33
- ) ;
33
+ ) ;
34
34
35
35
let keys: Vec < _ > = doc. iter ( ) . map ( |( key, _) | key. to_owned ( ) ) . collect ( ) ;
36
36
assert_eq ! ( expected_keys, keys) ;
You can’t perform that action at this time.
0 commit comments