Skip to content

Commit

Permalink
clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
turboladen committed May 30, 2024
1 parent f60c824 commit 56ea59b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/ffi/src/measurement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pub unsafe extern "C" fn measurement_div_scalar(
mod tests {
use super::*;
use approx::{assert_relative_eq, assert_ulps_eq};
use ffi_common::core;

use std::ffi::CString;

#[test]
Expand Down Expand Up @@ -516,7 +516,7 @@ mod tests {
let m = measurement_new(value, expression1.as_ptr());
let converted = measurement_convert_to(m, expression2.as_ptr());
assert_eq!(converted, ptr::null());
let error = CStr::from_ptr(core::error::get_last_err_msg());
let error = CStr::from_ptr(error::get_last_err_msg());
let error_str = error.to_str().expect("Failed to get str from CStr");
assert_eq!(error_str, expected_error);
}
Expand All @@ -533,11 +533,11 @@ mod tests {
// result is null, error is not null
let conversion_result_1 = measurement_convert_to(m, expression2.as_ptr());
assert_eq!(conversion_result_1, ptr::null());
assert_ne!(core::error::get_last_err_msg(), ptr::null());
assert_ne!(error::get_last_err_msg(), ptr::null());
// result is not null, error is null
let conversion_result_2 = measurement_convert_to(m, expression3.as_ptr());
assert_ne!(conversion_result_2, ptr::null());
assert_eq!(core::error::get_last_err_msg(), ptr::null());
assert_eq!(error::get_last_err_msg(), ptr::null());
}
}
}
4 changes: 2 additions & 2 deletions crates/ffi/src/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ pub unsafe extern "C" fn unit_composition_buf(
mod tests {
use super::*;
use approx::{assert_relative_eq, assert_ulps_eq};
use ffi_common::core;

use std::ffi::CString;

#[test]
Expand All @@ -289,7 +289,7 @@ mod tests {
unsafe {
let u = unit_new(expression.as_ptr());
assert_eq!(u, ptr::null());
let error = CStr::from_ptr(core::error::get_last_err_msg())
let error = CStr::from_ptr(error::get_last_err_msg())
.to_str()
.expect("Failed to get str from CStr.");
assert_eq!(error, expected_error);
Expand Down

0 comments on commit 56ea59b

Please sign in to comment.