Skip to content

Commit 27f18bc

Browse files
halzytoasteater
authored andcommitted
Fixing build errors, appeasing clippy.
1 parent 10510fb commit 27f18bc

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

bindings_generator/src/documentation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn official_doc_url(class: &GodotClass) -> String {
1818
}
1919

2020
pub fn generate_class_documentation(api: &Api, class: &GodotClass) -> TokenStream {
21-
let has_parent = class.base_class != "";
21+
let has_parent = !class.base_class.is_empty();
2222
let singleton_str = if class.singleton { "singleton " } else { "" };
2323
let ownership_type = if class.is_refcounted() {
2424
"reference counted"
@@ -81,7 +81,7 @@ if it is a `Node`."#,
8181
"".into()
8282
};
8383

84-
let base_class_docs = if class.base_class != "" {
84+
let base_class_docs = if !class.base_class.is_empty() {
8585
let mut docs = vec![];
8686
write!(
8787
&mut docs,
@@ -138,7 +138,7 @@ fn list_base_classes(output: &mut impl Write, api: &Api, parent_name: &str) -> G
138138

139139
writeln!(output, " - {}", class_link)?;
140140

141-
if parent.base_class != "" {
141+
if !parent.base_class.is_empty() {
142142
list_base_classes(output, api, &parent.base_class)?;
143143
}
144144
}

gdnative-core/src/core_types/geom/plane.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ impl Plane {
128128

129129
let dist = (self.normal.dot(begin) - self.d) / den;
130130

131-
if dist < -std::f32::EPSILON || dist > (1.0 + std::f32::EPSILON) {
131+
// check that dist is not in -EPSILON..(EPSILON+1)
132+
if !(-std::f32::EPSILON..=(std::f32::EPSILON + 1.0)).contains(&dist) {
132133
return None;
133134
}
134135

gdnative-core/src/core_types/variant.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ godot_test!(
18161816
test_variant_option {
18171817
use std::marker::PhantomData;
18181818

1819-
let variant = Some(42 as i64).to_variant();
1819+
let variant = Some(42_i64).to_variant();
18201820
assert_eq!(Some(42), variant.try_to_i64());
18211821

18221822
let variant = Option::<bool>::None.to_variant();
@@ -1841,11 +1841,11 @@ godot_test!(
18411841
}
18421842

18431843
test_variant_result {
1844-
let variant = Result::<i64, ()>::Ok(42 as i64).to_variant();
1844+
let variant = Result::<i64, ()>::Ok(42_i64).to_variant();
18451845
let dict = variant.try_to_dictionary().expect("should be dic");
18461846
assert_eq!(Some(42), dict.get("Ok").try_to_i64());
18471847

1848-
let variant = Result::<(), i64>::Err(54 as i64).to_variant();
1848+
let variant = Result::<(), i64>::Err(54_i64).to_variant();
18491849
let dict = variant.try_to_dictionary().expect("should be dic");
18501850
assert_eq!(Some(54), dict.get("Err").try_to_i64());
18511851

0 commit comments

Comments
 (0)