Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Mar 12, 2024
1 parent be57caa commit 7ac1b8d
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 28 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ faststr = "0.2"
json-benchmark = { git = "https://github.com/serde-rs/json-benchmark", default-features = false, features = ["all-files", "lib-serde"]}
paste = "1.0"
serde_bytes = "0.11"
bytes = {version = "1.4", features = ["serde"]}
chrono = { version = "0.4", features = ["serde"] }

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions fuzz/fuzz_targets/from_slice.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![no_main]
#![allow(clippy::mutable_key_type)]

use libfuzzer_sys::fuzz_target;
use serde_json::Value as JValue;
Expand Down
7 changes: 1 addition & 6 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ use core::{
fmt::{self, Debug, Display},
result,
};
use std::{
borrow::Cow,
error,
str::FromStr,
string::{String, ToString},
};
use std::{borrow::Cow, error, str::FromStr};

use serde::{de, ser};
use thiserror::Error as ErrorTrait;
Expand Down
2 changes: 0 additions & 2 deletions src/index.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::Into;

use crate::{
util::{private::Sealed, reborrow::DormantMutRef},
value::{
Expand Down
2 changes: 1 addition & 1 deletion src/lazyvalue/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl<'a> LazyValue<'a> {
#[cfg(test)]
mod test {
use super::*;
use crate::{get_unchecked, pointer, to_array_iter, value::JsonValueTrait};
use crate::{pointer, to_array_iter};

const TEST_JSON: &str = r#"{
"bool": true,
Expand Down
2 changes: 0 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ macro_rules! check_visit {
};
}

pub(crate) use perr;

#[inline(always)]
fn get_escaped_branchless_u64(prev_escaped: &mut u64, backslash: u64) -> u64 {
const EVEN_BITS: u64 = 0x5555_5555_5555_5555;
Expand Down
6 changes: 1 addition & 5 deletions src/serde/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ use core::{
fmt::{self, Display},
num::FpCategory,
};
use std::{
io,
string::{String, ToString},
vec::Vec,
};
use std::io;

use ::serde::ser::{self, Impossible, Serialize};

Expand Down
2 changes: 0 additions & 2 deletions src/util/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ mod lemire;
mod slow;
mod table;

use std::result::Result;

use self::{common::BiasedFp, float::RawFloat, table::POWER_OF_FIVE_128};
use crate::{error::ErrorCode, util::arch::simd_str2int};

Expand Down
2 changes: 1 addition & 1 deletion src/value/from.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, convert::Into, fmt::Debug, str::FromStr};
use std::{borrow::Cow, fmt::Debug, str::FromStr};

use faststr::FastStr;

Expand Down
5 changes: 1 addition & 4 deletions src/value/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1727,10 +1727,7 @@ mod test {
use std::path::Path;

use super::*;
use crate::{
error::{make_error, Result},
from_slice, from_str, pointer,
};
use crate::{error::make_error, from_slice, from_str, pointer};

#[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq)]
struct ValueInStruct {
Expand Down
2 changes: 1 addition & 1 deletion src/value/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ impl<'de> serde::de::Deserialize<'de> for Object {
#[cfg(test)]
mod test {
use super::*;
use crate::{from_str, object, to_string, Array, JsonValueMutTrait};
use crate::{from_str, to_string, Array, JsonValueMutTrait};

#[test]
fn test_object_serde() {
Expand Down
1 change: 0 additions & 1 deletion src/value/partial_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ impl_container_eq!(Array Object);
mod test {
use faststr::FastStr;

use crate::{array, json};
#[test]
fn test_slice_eq() {
assert_eq!(json!([1, 2, 3]), &[1, 2, 3]);
Expand Down
2 changes: 0 additions & 2 deletions src/value/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ impl Serializer {
}
}

use std::string::ToString;

use crate::serde::tri;

impl serde::Serializer for Serializer {
Expand Down

0 comments on commit 7ac1b8d

Please sign in to comment.