Skip to content

Commit 6158fe3

Browse files
authored
Merge pull request #49 from CosmWasm/test-and-fix-clippy
Test and fix clippy
2 parents 210fbf9 + 5b86270 commit 6158fe3

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

.github/workflows/Basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ jobs:
6464
uses: actions-rs/cargo@v1
6565
with:
6666
command: clippy
67-
args: -- -D warnings
67+
args: --all-targets -- -D warnings

src/de/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{error, fmt};
55
pub type Result<T> = core::result::Result<T, Error>;
66

77
/// This type represents all possible errors that can occur when deserializing JSON data
8-
#[derive(Debug, PartialEq)]
8+
#[derive(Debug, PartialEq, Eq)]
99
#[non_exhaustive]
1010
pub enum Error {
1111
/// Control character (U+0000 to U+001F) found in string. Those must always be escaped.

src/de/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,8 @@ mod tests {
805805
assert!(from_str::<[i32; 2]>("[0, 1,]").is_err());
806806
}
807807

808+
#[allow(clippy::let_unit_value)]
809+
#[allow(clippy::unit_cmp)]
808810
#[test]
809811
fn tuple() {
810812
type Pair = (i64, i64);
@@ -1193,18 +1195,18 @@ mod tests {
11931195

11941196
#[test]
11951197
fn deserialize_optional_vector() {
1196-
#[derive(Debug, Deserialize, PartialEq)]
1198+
#[derive(Debug, Deserialize, PartialEq, Eq)]
11971199
pub struct Response {
11981200
pub log: Option<String>,
11991201
pub messages: Vec<Msg>,
12001202
}
12011203

1202-
#[derive(Debug, Deserialize, PartialEq, serde_derive::Serialize)]
1204+
#[derive(Debug, Deserialize, PartialEq, Eq, serde_derive::Serialize)]
12031205
pub struct Msg {
12041206
pub name: String,
12051207
}
12061208

1207-
#[derive(Debug, Deserialize, PartialEq)]
1209+
#[derive(Debug, Deserialize, PartialEq, Eq)]
12081210
pub struct OptIn {
12091211
pub name: Option<String>,
12101212
}
@@ -1264,20 +1266,20 @@ mod tests {
12641266

12651267
#[test]
12661268
fn deserialize_embedded_enum() {
1267-
#[derive(Debug, Deserialize, PartialEq)]
1269+
#[derive(Debug, Deserialize, PartialEq, Eq)]
12681270
#[serde(rename_all = "lowercase")]
12691271
pub enum MyResult {
12701272
Ok(Response),
12711273
Err(String),
12721274
}
12731275

1274-
#[derive(Debug, Deserialize, PartialEq)]
1276+
#[derive(Debug, Deserialize, PartialEq, Eq)]
12751277
pub struct Response {
12761278
pub log: Option<String>,
12771279
pub messages: Vec<Msg>,
12781280
}
12791281

1280-
#[derive(Debug, Deserialize, PartialEq)]
1282+
#[derive(Debug, Deserialize, PartialEq, Eq)]
12811283
pub struct Msg {
12821284
pub name: String,
12831285
pub amount: Option<String>,

src/ser/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ mod tests {
708708
serde_json::to_string(&wrapped).unwrap()
709709
);
710710

711+
#[allow(clippy::let_unit_value)]
711712
let unit: Unit = ();
712713
assert_eq!(to_string(&unit).unwrap(), "null");
713714
assert_eq!(
@@ -1219,15 +1220,15 @@ mod tests {
12191220
fn serialize_embedded_enum() {
12201221
use serde_derive::Deserialize;
12211222

1222-
#[derive(Debug, Deserialize, Serialize, PartialEq)]
1223+
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
12231224
#[serde(rename_all = "lowercase")]
12241225
pub enum MyResult {
12251226
Unit(()),
12261227
Ok(Response),
12271228
Err(String),
12281229
}
12291230

1230-
#[derive(Debug, Deserialize, Serialize, PartialEq)]
1231+
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
12311232
pub struct Response {
12321233
pub log: Option<String>,
12331234
pub count: i64,

0 commit comments

Comments
 (0)