Skip to content

Commit 40d8f4f

Browse files
committed
rebase + minor cleanup#1
Signed-off-by: [email protected] <[email protected]>
1 parent aa7cfb1 commit 40d8f4f

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

src/event/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ pub mod url {
7272
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7373
if let ParseError::Error(v) = self {
7474
Ok(())
75-
}
76-
else{
77-
Err(fmt::Error{})
75+
} else {
76+
Err(fmt::Error {})
7877
}
7978
}
8079
}

src/event/spec_version.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use super::{v03, v10};
2-
use serde::export::Formatter;
3-
use snafu::Snafu;
42
use std::convert::TryFrom;
53
use std::fmt;
64
use std::fmt::Formatter;

tests/attributes_iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use cloudevents::event::AttributeValue;
33
use cloudevents::event::SpecVersion;
44
use test_data::*;
55

6-
#[cfg(feature="std")]
6+
#[cfg(feature = "std")]
77
#[test]
88
fn iter_v10_test() {
99
let in_event = v10::full_no_data();
@@ -15,7 +15,7 @@ fn iter_v10_test() {
1515
);
1616
}
1717

18-
#[cfg(feature="std")]
18+
#[cfg(feature = "std")]
1919
#[test]
2020
fn iter_v03_test() {
2121
let in_event = v03::full_json_data();

tests/message.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use cloudevents::{AttributesReader, EventBuilder, EventBuilderV03, EventBuilderV
55
use std::convert::TryInto;
66
use test_data::*;
77

8-
#[cfg(feature="std")]
8+
#[cfg(feature = "std")]
99
#[test]
1010
fn message_v03_roundtrip_structured() -> Result<()> {
1111
assert_eq!(
@@ -15,7 +15,7 @@ fn message_v03_roundtrip_structured() -> Result<()> {
1515
Ok(())
1616
}
1717

18-
#[cfg(feature="std")]
18+
#[cfg(feature = "std")]
1919
#[test]
2020
fn message_v03_roundtrip_binary() -> Result<()> {
2121
//TODO this code smells because we're missing a proper way in the public APIs
@@ -35,7 +35,7 @@ fn message_v03_roundtrip_binary() -> Result<()> {
3535
Ok(())
3636
}
3737

38-
#[cfg(feature="std")]
38+
#[cfg(feature = "std")]
3939
#[test]
4040
fn message_v10_roundtrip_structured() -> Result<()> {
4141
assert_eq!(
@@ -45,7 +45,7 @@ fn message_v10_roundtrip_structured() -> Result<()> {
4545
Ok(())
4646
}
4747

48-
#[cfg(feature="std")]
48+
#[cfg(feature = "std")]
4949
#[test]
5050
fn message_v10_roundtrip_binary() -> Result<()> {
5151
//TODO this code smells because we're missing a proper way in the public APIs

tests/serde_json.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod test_data;
77
use test_data::*;
88

99
/// This test is a parametrized test that uses data from tests/test_data
10-
#[cfg(feature="std")]
10+
#[cfg(feature = "std")]
1111
#[rstest(
1212
in_event,
1313
out_json,
@@ -54,7 +54,7 @@ fn serialize_should_succeed(in_event: Event, out_json: Value) {
5454
}
5555

5656
/// This test is a parametrized test that uses data from tests/test_data
57-
#[cfg(feature="std")]
57+
#[cfg(feature = "std")]
5858
#[rstest(
5959
in_json,
6060
out_event,

tests/test_data/v10.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ use super::*;
22
use cloudevents::{Event, EventBuilder, EventBuilderV10};
33
use serde_json::{json, Value};
44

5-
#[cfg(feature="std")]
5+
use cloudevents::event::UrlExtend;
6+
#[cfg(feature = "std")]
67
use url::Url;
7-
#[cfg(not(feature="std"))]
8+
#[cfg(not(feature = "std"))]
89
use String as Url;
9-
use cloudevents::event::UrlExtend;
1010

11-
#[cfg(feature="std")]
11+
#[cfg(feature = "std")]
1212
pub fn minimal() -> Event {
1313
EventBuilderV10::new()
1414
.id(id())
@@ -27,7 +27,7 @@ pub fn minimal_json() -> Value {
2727
})
2828
}
2929

30-
#[cfg(feature="std")]
30+
#[cfg(feature = "std")]
3131
pub fn full_no_data() -> Event {
3232
let (string_ext_name, string_ext_value) = string_extension();
3333
let (bool_ext_name, bool_ext_value) = bool_extension();
@@ -64,7 +64,7 @@ pub fn full_no_data_json() -> Value {
6464
})
6565
}
6666

67-
#[cfg(feature="std")]
67+
#[cfg(feature = "std")]
6868
pub fn full_json_data() -> Event {
6969
let (string_ext_name, string_ext_value) = string_extension();
7070
let (bool_ext_name, bool_ext_value) = bool_extension();
@@ -130,7 +130,7 @@ pub fn full_json_base64_data_json() -> Value {
130130
})
131131
}
132132

133-
#[cfg(feature="std")]
133+
#[cfg(feature = "std")]
134134
pub fn full_xml_string_data() -> Event {
135135
let (string_ext_name, string_ext_value) = string_extension();
136136
let (bool_ext_name, bool_ext_value) = bool_extension();
@@ -150,7 +150,7 @@ pub fn full_xml_string_data() -> Event {
150150
.unwrap()
151151
}
152152

153-
#[cfg(feature="std")]
153+
#[cfg(feature = "std")]
154154
pub fn full_xml_binary_data() -> Event {
155155
let (string_ext_name, string_ext_value) = string_extension();
156156
let (bool_ext_name, bool_ext_value) = bool_extension();

0 commit comments

Comments
 (0)