Skip to content

Commit

Permalink
Fix build on rustc <1.26
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfreyer committed May 28, 2018
1 parent 0ea48ce commit 28db52e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,25 +191,25 @@ impl<'a> convert::From<&'a CtlValue> for CtlType {
impl CtlType {
fn min_type_size(self: &Self) -> usize {
match self {
CtlType::None => 0,
CtlType::Node => 0,
CtlType::Int => mem::size_of::<libc::c_int>(),
CtlType::String => 0,
CtlType::S64 => mem::size_of::<i64>(),
CtlType::Struct => 0,
CtlType::Uint => mem::size_of::<libc::c_uint>(),
CtlType::Long => mem::size_of::<libc::c_long>(),
CtlType::Ulong => mem::size_of::<libc::c_ulong>(),
CtlType::U64 => mem::size_of::<u64>(),
CtlType::U8 => mem::size_of::<u8>(),
CtlType::U16 => mem::size_of::<u16>(),
CtlType::S8 => mem::size_of::<i8>(),
CtlType::S16 => mem::size_of::<i16>(),
CtlType::S32 => mem::size_of::<i32>(),
CtlType::U32 => mem::size_of::<u32>(),
&CtlType::None => 0,
&CtlType::Node => 0,
&CtlType::Int => mem::size_of::<libc::c_int>(),
&CtlType::String => 0,
&CtlType::S64 => mem::size_of::<i64>(),
&CtlType::Struct => 0,
&CtlType::Uint => mem::size_of::<libc::c_uint>(),
&CtlType::Long => mem::size_of::<libc::c_long>(),
&CtlType::Ulong => mem::size_of::<libc::c_ulong>(),
&CtlType::U64 => mem::size_of::<u64>(),
&CtlType::U8 => mem::size_of::<u8>(),
&CtlType::U16 => mem::size_of::<u16>(),
&CtlType::S8 => mem::size_of::<i8>(),
&CtlType::S16 => mem::size_of::<i16>(),
&CtlType::S32 => mem::size_of::<i32>(),
&CtlType::U32 => mem::size_of::<u32>(),
// Added custom types below
#[cfg(not(target_os = "macos"))]
CtlType::Temperature => 0,
&CtlType::Temperature => 0,
}
}
}
Expand Down

0 comments on commit 28db52e

Please sign in to comment.