diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-10-16 20:59:57 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-10-16 21:29:41 +0200 |
commit | 142f62abdf452d4d6a8cb00215ec465af80434ff (patch) | |
tree | 80de6ca1520f509a3d0a7831e0768a8b029e3975 /bindgen/clang.rs | |
parent | c424e034155660348ed77cfa92ec9869f617a625 (diff) |
ci: clippy fixes.
The allowed casts are because c_longlong etc aren't guaranteed to map to
i64 / etc. I believe c_double maps to f64 in all platforms tho.
Diffstat (limited to 'bindgen/clang.rs')
-rw-r--r-- | bindgen/clang.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bindgen/clang.rs b/bindgen/clang.rs index e5113391..ae140520 100644 --- a/bindgen/clang.rs +++ b/bindgen/clang.rs @@ -652,6 +652,7 @@ impl Cursor { pub fn enum_val_signed(&self) -> Option<i64> { unsafe { if self.kind() == CXCursor_EnumConstantDecl { + #[allow(clippy::unnecessary_cast)] Some(clang_getEnumConstantDeclValue(self.x) as i64) } else { None @@ -665,6 +666,7 @@ impl Cursor { pub fn enum_val_unsigned(&self) -> Option<u64> { unsafe { if self.kind() == CXCursor_EnumConstantDecl { + #[allow(clippy::unnecessary_cast)] Some(clang_getEnumConstantDeclUnsignedValue(self.x) as u64) } else { None @@ -2134,7 +2136,7 @@ impl EvalResult { pub fn as_double(&self) -> Option<f64> { match self.kind() { CXEval_Float => { - Some(unsafe { clang_EvalResult_getAsDouble(self.x) } as f64) + Some(unsafe { clang_EvalResult_getAsDouble(self.x) }) } _ => None, } @@ -2162,6 +2164,7 @@ impl EvalResult { if value < i64::min_value() as c_longlong { return None; } + #[allow(clippy::unnecessary_cast)] Some(value as i64) } |