mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Upgrade to the Rust 2024 edition (#2367)
* Update to rust 2024 edition * Fixes * Clean up imports * Cargo fmt again --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
use crate::node_registry;
|
||||
|
||||
use dyn_any::StaticType;
|
||||
use graph_craft::document::value::{TaggedValue, UpcastAsRefNode, UpcastNode};
|
||||
use graph_craft::Type;
|
||||
use graph_craft::document::NodeId;
|
||||
use graph_craft::document::value::{TaggedValue, UpcastAsRefNode, UpcastNode};
|
||||
use graph_craft::graphene_compiler::Executor;
|
||||
use graph_craft::proto::{ConstructionArgs, GraphError, LocalFuture, NodeContainer, ProtoNetwork, ProtoNode, SharedNodeContainer, TypeErasedBox, TypingContext};
|
||||
use graph_craft::proto::{GraphErrorType, GraphErrors};
|
||||
use graph_craft::Type;
|
||||
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::error::Error;
|
||||
use std::panic::UnwindSafe;
|
||||
@@ -266,8 +264,10 @@ impl BorrowTree {
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::HashMap;
|
||||
/// use graph_craft::{proto::*, document::*};
|
||||
/// use interpreted_executor::{node_registry, dynamic_executor::BorrowTree};
|
||||
/// use graph_craft::document::*;
|
||||
/// use graph_craft::proto::*;
|
||||
/// use interpreted_executor::dynamic_executor::BorrowTree;
|
||||
/// use interpreted_executor::node_registry;
|
||||
///
|
||||
///
|
||||
/// async fn example() -> Result<(), GraphErrors> {
|
||||
@@ -409,7 +409,6 @@ impl BorrowTree {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -4,9 +4,8 @@ pub mod util;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use graphene_core::*;
|
||||
|
||||
use futures::executor::block_on;
|
||||
use graphene_core::*;
|
||||
|
||||
#[test]
|
||||
fn double_number() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use dyn_any::StaticType;
|
||||
use glam::{DVec2, UVec2};
|
||||
use graph_craft::document::value::RenderOutput;
|
||||
use graph_craft::proto::{NodeConstructor, TypeErasedBox};
|
||||
use graphene_core::fn_type;
|
||||
@@ -7,23 +8,21 @@ use graphene_core::raster::image::ImageFrameTable;
|
||||
use graphene_core::raster::*;
|
||||
use graphene_core::value::{ClonedNode, ValueNode};
|
||||
use graphene_core::vector::VectorDataTable;
|
||||
use graphene_core::{concrete, generic, Artboard, GraphicGroupTable};
|
||||
use graphene_core::{fn_type_fut, future};
|
||||
use graphene_core::{Artboard, GraphicGroupTable, concrete, generic};
|
||||
use graphene_core::{Cow, ProtoNodeIdentifier, Type};
|
||||
use graphene_core::{Node, NodeIO, NodeIOTypes};
|
||||
use graphene_core::{fn_type_fut, future};
|
||||
use graphene_std::Context;
|
||||
use graphene_std::GraphicElement;
|
||||
use graphene_std::any::{ComposeTypeErased, DowncastBothNode, DynAnyNode, FutureWrapperNode, IntoTypeErasedNode};
|
||||
use graphene_std::application_io::ImageTexture;
|
||||
use graphene_std::wasm_application_io::*;
|
||||
use graphene_std::Context;
|
||||
use graphene_std::GraphicElement;
|
||||
#[cfg(feature = "gpu")]
|
||||
use wgpu_executor::{ShaderInputFrame, WgpuExecutor};
|
||||
use wgpu_executor::{WgpuSurface, WindowHandle};
|
||||
|
||||
use glam::{DVec2, UVec2};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
#[cfg(feature = "gpu")]
|
||||
use wgpu_executor::{ShaderInputFrame, WgpuExecutor};
|
||||
use wgpu_executor::{WgpuSurface, WindowHandle};
|
||||
|
||||
macro_rules! async_node {
|
||||
// TODO: we currently need to annotate the type here because the compiler would otherwise (correctly)
|
||||
@@ -193,7 +192,8 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
|
||||
// (
|
||||
// ProtoNodeIdentifier::new("graphene_core::raster::CurvesNode"),
|
||||
// |args| {
|
||||
// use graphene_core::raster::{curve::Curve, GenerateCurvesNode};
|
||||
// use graphene_core::raster::curve::Curve;
|
||||
// use graphene_core::raster::GenerateCurvesNode;
|
||||
// let curve: DowncastBothNode<(), Curve> = DowncastBothNode::new(args[0].clone());
|
||||
// Box::pin(async move {
|
||||
// let curve = ClonedNode::new(curve.eval(()).await);
|
||||
@@ -211,7 +211,8 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
|
||||
// (
|
||||
// ProtoNodeIdentifier::new("graphene_core::raster::CurvesNode"),
|
||||
// |args| {
|
||||
// use graphene_core::raster::{curve::Curve, GenerateCurvesNode};
|
||||
// use graphene_core::raster::curve::Curve;
|
||||
// use graphene_core::raster::GenerateCurvesNode;
|
||||
// let curve: DowncastBothNode<(), Curve> = DowncastBothNode::new(args[0].clone());
|
||||
// Box::pin(async move {
|
||||
// let curve = ValueNode::new(ClonedNode::new(curve.eval(()).await));
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use graph_craft::ProtoNodeIdentifier;
|
||||
use graph_craft::concrete;
|
||||
use graph_craft::document::{value::TaggedValue, DocumentNode, DocumentNodeImplementation, NodeInput, NodeNetwork};
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeInput, NodeNetwork};
|
||||
use graph_craft::generic;
|
||||
use graph_craft::wasm_application_io::WasmEditorApi;
|
||||
use graph_craft::ProtoNodeIdentifier;
|
||||
use graphene_std::uuid::NodeId;
|
||||
use graphene_std::Context;
|
||||
use graphene_std::uuid::NodeId;
|
||||
use std::sync::Arc;
|
||||
|
||||
// TODO: this is copy pasta from the editor (and does get out of sync)
|
||||
pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc<WasmEditorApi>) -> NodeNetwork {
|
||||
|
||||
Reference in New Issue
Block a user