Skip to content

Commit

Permalink
Adds u64_to_f64 and f64_to_u64 to src/util.rs to make usage cleaner. …
Browse files Browse the repository at this point in the history
…Updated for file/local.rs.
  • Loading branch information
kevloui committed Aug 6, 2020
1 parent 1e0a237 commit ad35272
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions amadeus-core/src/file/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use {
};

use super::{Directory, File, Page, Partition};
use crate::util::{IoError, ResultExpand};
use crate::util::{f64_to_u64, u64_to_f64, IoError, ResultExpand};

#[async_trait(?Send)]
impl<F> File for Vec<F>
Expand Down Expand Up @@ -359,28 +359,6 @@ impl LocalFile {
}
}

#[cfg(target_arch = "wasm32")]
#[allow(
clippy::cast_possible_truncation,
clippy::cast_sign_loss,
clippy::cast_precision_loss
)]
fn u64_to_f64(x: u64) -> f64 {
assert_eq!(x, x as f64 as u64);
x as f64
}
#[cfg(target_arch = "wasm32")]
#[allow(
clippy::cast_possible_truncation,
clippy::cast_sign_loss,
clippy::cast_precision_loss,
clippy::float_cmp
)]
fn f64_to_u64(x: f64) -> u64 {
assert_eq!(x, x as u64 as f64);
x as u64
}

#[cfg(target_arch = "wasm32")]
impl LocalFile {
fn read_at<'a>(
Expand Down

0 comments on commit ad35272

Please sign in to comment.