Skip to content

Commit 7d74193

Browse files
Avishay Yagodapyros82
Avishay Yagoda
authored andcommitted
Fixing all clippy errors
1 parent 2d25580 commit 7d74193

13 files changed

+218
-242
lines changed

Cargo.toml

+11-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ required-features = ["cmdline"]
2727
cmdline = ["anyhow", "clap"]
2828
default = []
2929
python = ["cpython"]
30-
wasm = ["wasm-bindgen"]
30+
wasm = ["serde-wasm-bindgen", "wasm-bindgen"]
3131

3232
[dependencies]
33-
phf = {version = "~0.8.0", features = ["macros"]}
33+
phf = { version = "~0.8.0", features = ["macros"] }
3434
serde_json = "~1.0.41"
3535
thiserror = "~1.0.11"
3636

@@ -39,6 +39,15 @@ features = ["serde-serialize"]
3939
optional = true
4040
version = "~0.2.62"
4141

42+
[dependencies.serde-wasm-bindgen]
43+
features = []
44+
optional = true
45+
version = "~0.6.5"
46+
47+
[dependencies.serde]
48+
features = ["derive"]
49+
version = "1"
50+
4251
[dependencies.cpython]
4352
features = ["extension-module"]
4453
optional = true

src/bin.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ use std::io::Read;
33

44
use anyhow::{Context, Result};
55
use clap::{App, Arg};
6-
use serde_json;
76
use serde_json::Value;
87

9-
use jsonlogic_rs;
10-
118
fn configure_args<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> {
129
app.version(env!("CARGO_PKG_VERSION"))
1310
.author("Matthew Planchard <[email protected]>")
@@ -67,7 +64,7 @@ fn main() -> Result<()> {
6764
let result = jsonlogic_rs::apply(&json_logic, &json_data)
6865
.context("Could not execute logic")?;
6966

70-
println!("{}", result.to_string());
67+
println!("{}", result);
7168

7269
Ok(())
7370
}

src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Error handling
22
//!
33
use serde_json::Value;
4-
use thiserror;
54

65
use crate::op::NumParams;
76

@@ -30,6 +29,7 @@ pub enum Error {
3029
#[error("Invalid variable mapping - {0} is not an object.")]
3130
InvalidVarMap(Value),
3231

32+
#[allow(clippy::enum_variant_names)]
3333
#[error("Encountered an unexpected error. Please raise an issue on GitHub and include the following error message: {0}")]
3434
UnexpectedError(String),
3535

0 commit comments

Comments
 (0)