Drop pub(crate) and use pub everywhere for now
This commit is contained in:
1 parent
214ffef6f3
commit
890b3f8c19
5 files changed
+48
-48
No files matched your search
+5
-5
@@ -11,24 +11,24 @@ pub enum UtilError {
|
||||
pub struct Utils {}
|
||||
|
||||
impl Utils {
|
||||
pub(crate) fn a_else_b(a: f64, b: f64) -> f64 {
|
||||
pub fn a_else_b(a: f64, b: f64) -> f64 {
|
||||
return if a > 0.0 { a } else { b };
|
||||
}
|
||||
pub(crate) fn ewma_factor(tick: f64, dur: f64) -> f64 {
|
||||
pub fn ewma_factor(tick: f64, dur: f64) -> f64 {
|
||||
((0.5_f64).ln() / (dur / tick)).exp()
|
||||
}
|
||||
pub(crate) fn get_current_time() -> Result<(f64, f64), UtilError> {
|
||||
pub fn get_current_time() -> Result<(f64, f64), UtilError> {
|
||||
let time = clock_gettime(ClockId::CLOCK_MONOTONIC)?;
|
||||
Ok((time.tv_sec() as f64, time.tv_nsec() as f64))
|
||||
}
|
||||
|
||||
#[cfg(target_endian = "big")]
|
||||
pub(crate) fn to_ne(val: u64) -> u64 {
|
||||
pub fn to_ne(val: u64) -> u64 {
|
||||
val.to_be()
|
||||
}
|
||||
|
||||
#[cfg(target_endian = "little")]
|
||||
pub(crate) fn to_ne(val: u32) -> u32 {
|
||||
pub fn to_ne(val: u32) -> u32 {
|
||||
val.to_le()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user