fix: clippy cleanup
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1432,6 +1432,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "bevy_sk"
|
name = "bevy_sk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/Schmarni-Dev/bevy_sk?branch=fix_mat_stuff#744e9bb442a690b1abc15f50ba2655228bd84eea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"bevy_mod_xr",
|
"bevy_mod_xr",
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#![allow(clippy::empty_docs)]
|
#![allow(clippy::empty_docs)]
|
||||||
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
mod core;
|
mod core;
|
||||||
mod nodes;
|
mod nodes;
|
||||||
mod objects;
|
mod objects;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ impl AliasList {
|
|||||||
let Ok(aspect2) = node.get_aspect::<A>() else {
|
let Ok(aspect2) = node.get_aspect::<A>() else {
|
||||||
return false;
|
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>> {
|
pub fn get_aliases(&self) -> Vec<Arc<Node>> {
|
||||||
@@ -150,7 +150,7 @@ impl AliasList {
|
|||||||
let Ok(aspect2) = original.get_aspect::<A>() else {
|
let Ok(aspect2) = original.get_aspect::<A>() else {
|
||||||
return false;
|
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
|
a.handler_order
|
||||||
.lock()
|
.lock()
|
||||||
.iter()
|
.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 out methods without the proper alias
|
||||||
.filter_map(|m| {
|
.filter_map(|m| {
|
||||||
@@ -168,7 +168,7 @@ pub fn process_input() {
|
|||||||
a.set_enabled(true);
|
a.set_enabled(true);
|
||||||
})
|
})
|
||||||
// serialize the data
|
// 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<_>>();
|
.unzip::<_, _, Vec<_>, Vec<_>>();
|
||||||
drop(ser_span);
|
drop(ser_span);
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ impl Node {
|
|||||||
message: Message,
|
message: Message,
|
||||||
) -> Result<(), ScenegraphError> {
|
) -> Result<(), ScenegraphError> {
|
||||||
if let Ok(alias) = self.get_aspect::<Alias>() {
|
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);
|
return Err(ScenegraphError::MemberNotFound);
|
||||||
}
|
}
|
||||||
alias
|
alias
|
||||||
@@ -208,7 +208,7 @@ impl Node {
|
|||||||
response: MethodResponseSender,
|
response: MethodResponseSender,
|
||||||
) {
|
) {
|
||||||
if let Ok(alias) = self.get_aspect::<Alias>() {
|
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));
|
response.send(Err(ScenegraphError::MemberNotFound));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -329,9 +329,11 @@ impl SkHand {
|
|||||||
*self.input.datamap.lock() = Datamap::from_typed(&self.datamap).unwrap();
|
*self.input.datamap.lock() = Datamap::from_typed(&self.datamap).unwrap();
|
||||||
let captured = self.capture_manager.capture.upgrade().is_some();
|
let captured = self.capture_manager.capture.upgrade().is_some();
|
||||||
if captured && !self.captured {
|
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 {
|
} 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;
|
self.captured = captured;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user