fix: clippy cleanup
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1432,6 +1432,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "bevy_sk"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/Schmarni-Dev/bevy_sk?branch=fix_mat_stuff#744e9bb442a690b1abc15f50ba2655228bd84eea"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"bevy_mod_xr",
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#![allow(clippy::empty_docs)]
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
mod core;
|
||||
mod nodes;
|
||||
mod objects;
|
||||
|
||||
@@ -136,7 +136,7 @@ impl AliasList {
|
||||
let Ok(aspect2) = node.get_aspect::<A>() else {
|
||||
return false;
|
||||
};
|
||||
Arc::as_ptr(&aspect2) == (aspect as *const A)
|
||||
std::ptr::eq(Arc::as_ptr(&aspect2), aspect)
|
||||
})
|
||||
}
|
||||
pub fn get_aliases(&self) -> Vec<Arc<Node>> {
|
||||
@@ -150,7 +150,7 @@ impl AliasList {
|
||||
let Ok(aspect2) = original.get_aspect::<A>() else {
|
||||
return false;
|
||||
};
|
||||
Arc::as_ptr(&aspect2) != (aspect as *const A)
|
||||
!std::ptr::eq(Arc::as_ptr(&aspect2), aspect)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ pub fn process_input() {
|
||||
a.handler_order
|
||||
.lock()
|
||||
.iter()
|
||||
.any(|h| h.ptr_eq(&Arc::downgrade(&handler)))
|
||||
.any(|h| h.ptr_eq(&Arc::downgrade(handler)))
|
||||
})
|
||||
// filter out methods without the proper alias
|
||||
.filter_map(|m| {
|
||||
@@ -168,7 +168,7 @@ pub fn process_input() {
|
||||
a.set_enabled(true);
|
||||
})
|
||||
// serialize the data
|
||||
.map(|(a, m)| (a.clone(), m.serialize(a.get_id(), &handler)))
|
||||
.map(|(a, m)| (a.clone(), m.serialize(a.get_id(), handler)))
|
||||
.unzip::<_, _, Vec<_>, Vec<_>>();
|
||||
drop(ser_span);
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ impl Node {
|
||||
message: Message,
|
||||
) -> Result<(), ScenegraphError> {
|
||||
if let Ok(alias) = self.get_aspect::<Alias>() {
|
||||
if !alias.info.server_signals.iter().any(|e| *e == method) {
|
||||
if !alias.info.server_signals.contains(&method) {
|
||||
return Err(ScenegraphError::MemberNotFound);
|
||||
}
|
||||
alias
|
||||
@@ -208,7 +208,7 @@ impl Node {
|
||||
response: MethodResponseSender,
|
||||
) {
|
||||
if let Ok(alias) = self.get_aspect::<Alias>() {
|
||||
if !alias.info.server_methods.iter().any(|e| *e == method) {
|
||||
if !alias.info.server_methods.contains(&method) {
|
||||
response.send(Err(ScenegraphError::MemberNotFound));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -329,9 +329,11 @@ impl SkHand {
|
||||
*self.input.datamap.lock() = Datamap::from_typed(&self.datamap).unwrap();
|
||||
let captured = self.capture_manager.capture.upgrade().is_some();
|
||||
if captured && !self.captured {
|
||||
materials.get_mut(&self.material).unwrap().base_color = Srgba::rgb(0., 1., 0.75).into();
|
||||
materials.get_mut(&self.material).unwrap().base_color =
|
||||
Srgba::rgb(0., 1., 0.75).into();
|
||||
} else if self.captured && !captured {
|
||||
materials.get_mut(&self.material).unwrap().base_color = Srgba::rgb(1., 1.0, 1.0).into();
|
||||
materials.get_mut(&self.material).unwrap().base_color =
|
||||
Srgba::rgb(1., 1.0, 1.0).into();
|
||||
}
|
||||
self.captured = captured;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user