fix: clippy
This commit is contained in:
@@ -18,7 +18,7 @@ pub struct Alias {
|
||||
pub info: AliasInfo,
|
||||
}
|
||||
impl Alias {
|
||||
pub fn new(
|
||||
pub fn create(
|
||||
client: &Arc<Client>,
|
||||
parent: &str,
|
||||
name: &str,
|
||||
|
||||
@@ -206,7 +206,7 @@ pub fn ray_march(ray: Ray, field: &Field) -> RayMarchResult {
|
||||
}
|
||||
|
||||
pub fn find_field(client: &Client, path: &str) -> Result<Arc<Field>> {
|
||||
Ok(client
|
||||
client
|
||||
.get_node("Field", path)?
|
||||
.get_aspect("Field", "info", |n| &n.field)?)
|
||||
.get_aspect("Field", "info", |n| &n.field)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ pub fn frame(sk: &StereoKit) {
|
||||
}
|
||||
|
||||
pub fn make_alias(client: &Arc<Client>) -> Arc<Node> {
|
||||
Alias::new(
|
||||
Alias::create(
|
||||
client,
|
||||
"",
|
||||
"hmd",
|
||||
|
||||
@@ -5,7 +5,7 @@ use super::fields::Field;
|
||||
use super::spatial::{find_spatial_parent, parse_transform, Spatial};
|
||||
use super::{Alias, Node};
|
||||
use crate::core::client::{Client, INTERNAL_CLIENT};
|
||||
use crate::core::nodelist::LifeLinkedNodeList;
|
||||
use crate::core::node_collections::LifeLinkedNodeList;
|
||||
use crate::core::registry::Registry;
|
||||
use crate::nodes::alias::AliasInfo;
|
||||
use crate::nodes::fields::find_field;
|
||||
@@ -121,7 +121,7 @@ impl Item {
|
||||
item
|
||||
}
|
||||
fn make_alias(&self, client: &Arc<Client>, parent: &str) -> (Arc<Node>, Arc<Alias>) {
|
||||
let node = Alias::new(
|
||||
let node = Alias::create(
|
||||
client,
|
||||
parent,
|
||||
&self.uid,
|
||||
@@ -273,7 +273,7 @@ impl ItemAcceptor {
|
||||
fn make_aliases(&self, client: &Arc<Client>, parent: &str) -> Vec<Arc<Node>> {
|
||||
let mut aliases = Vec::new();
|
||||
let acceptor_node = &self.node.upgrade().unwrap();
|
||||
let acceptor_alias = Alias::new(
|
||||
let acceptor_alias = Alias::create(
|
||||
client,
|
||||
parent,
|
||||
acceptor_node.uid.as_str(),
|
||||
@@ -284,7 +284,7 @@ impl ItemAcceptor {
|
||||
},
|
||||
);
|
||||
if let Some(field) = self.field.lock().upgrade() {
|
||||
let acceptor_field_alias = Alias::new(
|
||||
let acceptor_field_alias = Alias::create(
|
||||
client,
|
||||
acceptor_alias.get_path(),
|
||||
"field",
|
||||
|
||||
@@ -18,7 +18,7 @@ use std::sync::{Arc, Weak};
|
||||
static ZONEABLE_REGISTRY: Registry<Spatial> = Registry::new();
|
||||
|
||||
pub struct Spatial {
|
||||
pub(self) uid: String,
|
||||
uid: String,
|
||||
pub(super) node: Weak<Node>,
|
||||
parent: Mutex<Option<Arc<Spatial>>>,
|
||||
pub(self) old_parent: Mutex<Option<Arc<Spatial>>>,
|
||||
@@ -296,10 +296,9 @@ pub fn find_spatial(
|
||||
node_name: &'static str,
|
||||
node_path: &str,
|
||||
) -> anyhow::Result<Arc<Spatial>> {
|
||||
Ok(calling_client
|
||||
calling_client
|
||||
.get_node(node_name, node_path)?
|
||||
.get_aspect(node_name, "spatial", |n| &n.spatial)?
|
||||
.clone())
|
||||
.get_aspect(node_name, "spatial", |n| &n.spatial)
|
||||
}
|
||||
pub fn find_spatial_parent(
|
||||
calling_client: &Arc<Client>,
|
||||
|
||||
@@ -111,7 +111,7 @@ impl Zone {
|
||||
self_zone_distance < 0.0 && spatial_zone_distance > self_zone_distance
|
||||
})
|
||||
.map(|zoneable| {
|
||||
let alias = Alias::new(
|
||||
let alias = Alias::create(
|
||||
&zone_client,
|
||||
zone_node.get_path(),
|
||||
&zoneable.uid,
|
||||
|
||||
Reference in New Issue
Block a user