Skip to content

Commit

Permalink
Clippy pass with --no-default-features
Browse files Browse the repository at this point in the history
  • Loading branch information
Grinkers committed Nov 7, 2023
1 parent f5adbac commit a288ffe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/deserialize/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::edn::{Edn, Error};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::collections::{BTreeMap, HashMap};
#[cfg(feature = "sets")]
use std::collections::{BTreeSet, HashSet};
use std::convert::TryFrom;
use std::str::FromStr;

Expand Down
12 changes: 7 additions & 5 deletions src/deserialize/parse.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#[cfg(feature = "sets")]
use crate::edn::Set;
use crate::edn::{Edn, Error, List, Map, Vector};
use std::collections::{BTreeMap, BTreeSet};
use std::collections::BTreeMap;
#[cfg(feature = "sets")]
use std::collections::BTreeSet;

const DELIMITERS: [char; 8] = [',', ']', '}', ')', ';', '(', '[', '{'];

Expand Down Expand Up @@ -442,10 +444,10 @@ fn read_set(chars: &mut std::iter::Enumerate<std::str::Chars>) -> Result<Edn, Er
}

#[cfg(not(feature = "sets"))]
fn read_set(chars: &mut std::iter::Enumerate<std::str::Chars>) -> Result<Edn, Error> {
Err(Error::ParseEdn(format!(
"Could not parse set due to feature not being enabled"
)))
fn read_set(_chars: &mut std::iter::Enumerate<std::str::Chars>) -> Result<Edn, Error> {
Err(Error::ParseEdn(
"Could not parse set due to feature not being enabled".to_string(),
))
}

fn read_namespaced_map(chars: &mut std::iter::Enumerate<std::str::Chars>) -> Result<Edn, Error> {
Expand Down
7 changes: 5 additions & 2 deletions src/edn/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::deserialize::parse::{self};
#[cfg(feature = "sets")]
use std::cmp::{Ord, PartialOrd};
use std::collections::{BTreeMap, BTreeSet};
use std::collections::BTreeMap;
#[cfg(feature = "sets")]
use std::collections::BTreeSet;
use std::convert::TryFrom;
use utils::index::Index;

Expand Down Expand Up @@ -82,7 +85,7 @@ impl Double {

#[cfg(not(feature = "sets"))]
impl Double {
fn to_float(&self) -> f64 {
const fn to_float(&self) -> f64 {
self.0
}
}
Expand Down

0 comments on commit a288ffe

Please sign in to comment.