Skip to content

Commit 6ae87b2

Browse files
Correct warnings
1 parent 47e3e9c commit 6ae87b2

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

crates/readstat/src/cb.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,16 @@ pub extern "C" fn handle_metadata(
5959
.format("%Y-%m-%d %H:%M:%S")
6060
.to_string();
6161
let compression = match FromPrimitive::from_i32(unsafe {
62-
readstat_sys::readstat_get_compression(metadata) as i32
62+
readstat_sys::readstat_get_compression(metadata)
6363
}) {
6464
Some(t) => t,
6565
None => ReadStatCompress::None,
6666
};
67-
let endianness = match FromPrimitive::from_i32(unsafe {
68-
readstat_sys::readstat_get_endianness(metadata) as i32
69-
}) {
70-
Some(t) => t,
71-
None => ReadStatEndian::None,
72-
};
67+
let endianness =
68+
match FromPrimitive::from_i32(unsafe { readstat_sys::readstat_get_endianness(metadata) }) {
69+
Some(t) => t,
70+
None => ReadStatEndian::None,
71+
};
7372

7473
debug!("row_count is {}", rc);
7574
debug!("var_count is {}", vc);
@@ -132,14 +131,14 @@ pub extern "C" fn handle_variable(
132131

133132
// get variable metadata
134133
let var_type = match FromPrimitive::from_i32(unsafe {
135-
readstat_sys::readstat_variable_get_type(variable) as i32
134+
readstat_sys::readstat_variable_get_type(variable)
136135
}) {
137136
Some(t) => t,
138137
None => ReadStatVarType::Unknown,
139138
};
140139

141140
let var_type_class = match FromPrimitive::from_i32(unsafe {
142-
readstat_sys::readstat_variable_get_type_class(variable) as i32
141+
readstat_sys::readstat_variable_get_type_class(variable)
143142
}) {
144143
Some(t) => t,
145144
None => ReadStatVarTypeClass::Numeric,

0 commit comments

Comments
 (0)