Skip to content

Commit

Permalink
Fix compile errors only happens in cargo install. (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
r12f authored Jul 22, 2021
1 parent 2295930 commit bdd349a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ socket2 = "0.4.0"
futures-intrusive = "0.4"
tokio = { version = "1", features = ["rt-multi-thread", "time", "sync", "macros"] }
contracts = "0.6.0"
chrono = "0.4"
chrono = { version = "0.4", features = ["serde", "rustc-serialize"] }
rand = "0.8"
thiserror = "1.0.26"
async-trait = "0.1.50"
Expand Down
2 changes: 2 additions & 0 deletions src/ping_port_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct PingPortPicker {
}

impl PingPortPicker {
#[allow(unreachable_code)]
#[requires(min_port > 0)]
#[requires(max_port > 0)]
#[requires(min_port <= max_port)]
Expand Down Expand Up @@ -57,6 +58,7 @@ impl PingPortPicker {
return Some(self.fetch_next_available_port_from_port_range());
}

#[allow(unreachable_code)]
#[requires(self.port_list.is_some())]
fn fetch_next_available_port_from_port_list(&mut self) -> u16 {
let port = self.port_list.as_ref().unwrap()[self.next_port_index];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct PingResultProcessorLatencyBucketLogger {

impl PingResultProcessorLatencyBucketLogger {
#[tracing::instrument(name = "Creating ping result latency bucket logger", level = "debug")]
#[allow(unreachable_code)]
#[requires(buckets.len() >= 1)]
pub fn new(buckets: &Vec<f64>) -> PingResultProcessorLatencyBucketLogger {
// The buckets from settings are treated as separators, so the real buckets are:
Expand Down

0 comments on commit bdd349a

Please sign in to comment.