Skip to content

Commit ede2291

Browse files
authored
Compile on targets where c_char ≠ i8 (#403)
Fix function which took a i8 where c_char is more correct. Fixes compilation where those two types aren't equivalent (ex: aarch64)
1 parent c509f9f commit ede2291

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rclrs/src/parameter/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ fn get_parameters(req: GetParameters_Request, map: &ParameterMap) -> GetParamete
123123
}
124124

125125
fn list_parameters(req: ListParameters_Request, map: &ParameterMap) -> ListParameters_Response {
126-
let check_parameter_name_depth = |substring: &[i8]| {
126+
let check_parameter_name_depth = |substring: &[std::os::raw::c_char]| {
127127
if req.depth == ListParameters_Request::DEPTH_RECURSIVE {
128128
return true;
129129
}
130-
u64::try_from(substring.iter().filter(|c| **c == ('.' as i8)).count()).unwrap() < req.depth
130+
u64::try_from(substring.iter().filter(|c| **c == ('.' as _)).count()).unwrap() < req.depth
131131
};
132132
let names: Sequence<_> = map
133133
.storage

0 commit comments

Comments
 (0)