Skip to content

Commit

Permalink
Fixed clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcmaster committed Jul 18, 2024
1 parent 4bdaf2d commit 1a8472a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl<T: Serialize> Channel<T> {

/// notify all OnDemand with an event listener
fn notify_all_on_demand(&self) {
self.on_demand_events.notify(std::usize::MAX);
self.on_demand_events.notify(usize::MAX);
}

/// create a listener so an OnDemand can get notice when demand has been requested
Expand All @@ -199,7 +199,7 @@ impl<T: Serialize> Channel<T> {

/// notify all senders with an event listener
fn notify_all_senders(&self) {
self.sender_events.notify(std::usize::MAX);
self.sender_events.notify(usize::MAX);
}

/// notify a single receiver with an event listener
Expand All @@ -209,7 +209,7 @@ impl<T: Serialize> Channel<T> {

/// notify all receivers with an event listener
fn notify_all_receivers(&self) {
self.receiver_events.notify(std::usize::MAX);
self.receiver_events.notify(usize::MAX);
}

/// create a listener so a sender can get notice when it can make progress
Expand Down
4 changes: 2 additions & 2 deletions lib/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ impl FromYaml for RangeProviderPreProcessed {
let mut saw_opening = false;

let mut start = 0;
let mut end = std::i64::MAX;
let mut end = i64::MAX;
let mut step = NonZeroU16::new(1).expect("1 is non-zero");
let mut repeat = false;
let mut unique = false;
Expand Down Expand Up @@ -3193,7 +3193,7 @@ mod tests {
"range: {}",
Some(ProviderPreProcessed::Range(RangeProviderPreProcessed {
start: 0,
end: std::i64::MAX,
end: i64::MAX,
step: NonZeroU16::new(1).expect("1 is non-zero"),
repeat: false,
unique: false,
Expand Down
4 changes: 2 additions & 2 deletions lib/config/src/select_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ pub(super) fn f64_value(json: &json::Value) -> f64 {
if let Some(f) = json.as_f64() {
f
} else {
std::f64::NAN
f64::NAN
}
}

Expand Down Expand Up @@ -862,7 +862,7 @@ static INFIX_OPERATOR_PRECEDENCE: [u8; 13] = [
];

fn to_json_number(n: f64) -> json::Value {
if n - n.trunc() < std::f64::EPSILON {
if (n - n.trunc()).abs() < f64::EPSILON {
(n as u64).into()
} else {
n.into()
Expand Down
1 change: 1 addition & 0 deletions src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ impl ProviderStream<AutoReturn> for providers::Provider {

pub struct BuilderContext {
pub config: config::Config,
#[allow(dead_code)]
pub config_path: PathBuf,
// the http client
pub client:
Expand Down
1 change: 1 addition & 0 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ pub enum StatsMessage {
pub struct ResponseStat {
pub kind: StatKind,
pub rtt: Option<u64>,
#[allow(dead_code)]
pub time: SystemTime,
pub tags: Arc<Tags>,
}
Expand Down

0 comments on commit 1a8472a

Please sign in to comment.