mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
Fix clippy lints (#1327)
* Fix clippy lints * Update formatting * Remove unsafe send impls * New type for Rc<NodeContainer>
This commit is contained in:
committed by
Keavon Chambers
parent
743803ce04
commit
80cc5bee73
@@ -26,7 +26,7 @@ num-traits = "0.2"
|
||||
dyn-clone = "1.0"
|
||||
log = "0.4"
|
||||
serde = { version = "1", features = ["derive"], optional = true }
|
||||
glam = { version = "0.22" }
|
||||
glam = { version = "0.24" }
|
||||
once_cell = "1.17.0"
|
||||
futures = "0.3.28"
|
||||
typed-arena = "2.0.2"
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::error::Error;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use dyn_any::StaticType;
|
||||
use graph_craft::document::value::{TaggedValue, UpcastNode};
|
||||
use graph_craft::document::NodeId;
|
||||
use graph_craft::graphene_compiler::Executor;
|
||||
use graph_craft::proto::{ConstructionArgs, LocalFuture, NodeContainer, ProtoNetwork, ProtoNode, TypeErasedBox, TypingContext};
|
||||
use graph_craft::proto::{ConstructionArgs, LocalFuture, NodeContainer, ProtoNetwork, ProtoNode, SharedNodeContainer, TypeErasedBox, TypingContext};
|
||||
use graph_craft::Type;
|
||||
|
||||
use crate::node_registry;
|
||||
@@ -80,7 +79,7 @@ impl<'a, I: StaticType + 'a> Executor<I, TaggedValue> for &'a DynamicExecutor {
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct BorrowTree {
|
||||
nodes: HashMap<NodeId, Arc<NodeContainer>>,
|
||||
nodes: HashMap<NodeId, SharedNodeContainer>,
|
||||
source_map: HashMap<Vec<NodeId>, NodeId>,
|
||||
}
|
||||
|
||||
@@ -109,11 +108,11 @@ impl BorrowTree {
|
||||
Ok(old_nodes.into_iter().collect())
|
||||
}
|
||||
|
||||
fn node_deps(&self, nodes: &[NodeId]) -> Vec<Arc<NodeContainer>> {
|
||||
fn node_deps(&self, nodes: &[NodeId]) -> Vec<SharedNodeContainer> {
|
||||
nodes.iter().map(|node| self.nodes.get(node).unwrap().clone()).collect()
|
||||
}
|
||||
|
||||
fn store_node(&mut self, node: Arc<NodeContainer>, id: NodeId) {
|
||||
fn store_node(&mut self, node: SharedNodeContainer, id: NodeId) {
|
||||
self.nodes.insert(id, node);
|
||||
}
|
||||
|
||||
@@ -123,7 +122,7 @@ impl BorrowTree {
|
||||
Some(node.serialize())
|
||||
}
|
||||
|
||||
pub fn get(&self, id: NodeId) -> Option<Arc<NodeContainer>> {
|
||||
pub fn get(&self, id: NodeId) -> Option<SharedNodeContainer> {
|
||||
self.nodes.get(&id).cloned()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use graph_craft::imaginate_input::{ImaginateCache, ImaginateController, ImaginateMaskStartingFill, ImaginateSamplingMethod};
|
||||
use graph_craft::imaginate_input::{ImaginateController, ImaginateMaskStartingFill, ImaginateSamplingMethod};
|
||||
use graph_craft::proto::{NodeConstructor, TypeErasedBox};
|
||||
use graphene_core::ops::IdNode;
|
||||
use graphene_core::quantization::{PackedPixel, QuantizationChannels};
|
||||
@@ -464,7 +464,7 @@ fn node_registry() -> HashMap<NodeIdentifier, HashMap<NodeIOTypes, NodeConstruct
|
||||
),
|
||||
(
|
||||
NodeIdentifier::new("graphene_std::raster::ImaginateNode<_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _>"),
|
||||
|args: Vec<Arc<graph_craft::proto::NodeContainer>>| {
|
||||
|args: Vec<graph_craft::proto::SharedNodeContainer>| {
|
||||
Box::pin(async move {
|
||||
use graphene_std::raster::ImaginateNode;
|
||||
macro_rules! instanciate_imaginate_node {
|
||||
|
||||
Reference in New Issue
Block a user