From 7778dc4d47ea81898c89b91169c187afa7dfd2f6 Mon Sep 17 00:00:00 2001 From: LJ Date: Wed, 14 May 2025 15:19:59 -0700 Subject: [PATCH] chore(rust-lang): switch Rust edition from 2021 to 2024 --- Cargo.toml | 2 +- src/builder/analyzed_flow.rs | 2 +- src/builder/analyzer.rs | 16 ++++++++-------- src/execution/evaluator.rs | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3fc30c83..1a19b22b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cocoindex" # Version used for local development is always higher than others to take precedence. # Will be overridden for specific release versions. version = "999.0.0" -edition = "2021" +edition = "2024" [profile.release] codegen-units = 1 diff --git a/src/builder/analyzed_flow.rs b/src/builder/analyzed_flow.rs index 7435c5ba..544cd95c 100644 --- a/src/builder/analyzed_flow.rs +++ b/src/builder/analyzed_flow.rs @@ -3,7 +3,7 @@ use crate::{ops::interface::FlowInstanceContext, prelude::*}; use super::{analyzer, plan}; use crate::{ ops::registry::ExecutorFactoryRegistry, - service::error::{shared_ok, SharedError, SharedResultExt}, + service::error::{SharedError, SharedResultExt, shared_ok}, setup::{self, ObjectSetupStatus}, }; diff --git a/src/builder/analyzer.rs b/src/builder/analyzer.rs index 83472764..2cd7ce1a 100644 --- a/src/builder/analyzer.rs +++ b/src/builder/analyzer.rs @@ -12,8 +12,8 @@ use crate::{ base::{schema::*, spec::*}, ops::{interface::*, registry::*}, }; -use futures::future::{try_join3, BoxFuture}; -use futures::{future::try_join_all, FutureExt}; +use futures::future::{BoxFuture, try_join3}; +use futures::{FutureExt, future::try_join_all}; #[derive(Debug)] pub(super) enum ValueTypeBuilder { @@ -668,7 +668,7 @@ impl AnalyzerContext<'_> { import_op: NamedSpec, metadata: Option<&mut FlowSetupMetadata>, existing_source_states: Option<&Vec<&SourceSetupState>>, - ) -> Result> + Send> { + ) -> Result> + Send + use<>> { let factory = self.registry.get(&import_op.spec.source.kind); let source_factory = match factory { Some(ExecutorFactory::Source(source_executor)) => source_executor.clone(), @@ -676,7 +676,7 @@ impl AnalyzerContext<'_> { return Err(anyhow::anyhow!( "Source executor not found for kind: {}", import_op.spec.source.kind - )) + )); } }; let (output_type, executor) = source_factory.build( @@ -817,7 +817,7 @@ impl AnalyzerContext<'_> { return Err(anyhow::anyhow!( "Transform op kind not found: {}", op.op.kind - )) + )); } } } @@ -967,7 +967,7 @@ impl AnalyzerContext<'_> { declarations: Vec, flow_setup_state: &mut FlowSetupState, existing_target_states: &HashMap<&ResourceIdentifier, Vec<&TargetSetupState>>, - ) -> Result> + Send>> { + ) -> Result> + Send + use<>>> { let mut collection_specs = Vec::::new(); let mut data_fields_infos = Vec::::new(); for idx in export_op_group.op_idx.iter() { @@ -1104,7 +1104,7 @@ impl AnalyzerContext<'_> { &self, op_scope: &Arc, reactive_ops: &[NamedSpec], - ) -> Result> + Send> { + ) -> Result> + Send + use<>> { let op_futs = reactive_ops .iter() .map(|reactive_op| self.analyze_reactive_op(op_scope, reactive_op)) @@ -1147,7 +1147,7 @@ pub fn analyze_flow( registry: &ExecutorFactoryRegistry, ) -> Result<( FlowSchema, - impl Future> + Send, + impl Future> + Send + use<>, setup::FlowSetupState, )> { let existing_metadata_versions = || { diff --git a/src/execution/evaluator.rs b/src/execution/evaluator.rs index 9da0b8cd..90bd7c64 100644 --- a/src/execution/evaluator.rs +++ b/src/execution/evaluator.rs @@ -1,17 +1,17 @@ use std::sync::{Mutex, OnceLock}; use std::{borrow::Cow, collections::BTreeMap}; -use anyhow::{bail, Context, Ok, Result}; +use anyhow::{Context, Ok, Result, bail}; use futures::future::try_join_all; -use crate::builder::{plan::*, AnalyzedTransientFlow}; +use crate::builder::{AnalyzedTransientFlow, plan::*}; use crate::py::IntoPyResult; use crate::{ base::{schema, value}, utils::immutable::RefList, }; -use super::memoization::{evaluate_with_cell, EvaluationMemory, EvaluationMemoryOptions}; +use super::memoization::{EvaluationMemory, EvaluationMemoryOptions, evaluate_with_cell}; #[derive(Debug)] pub struct ScopeValueBuilder { @@ -183,7 +183,7 @@ impl<'a> ScopeEntry<'a> { ) -> &'b value::KeyValue { if indices.is_empty() { key_val - } else if let value::KeyValue::Struct(ref fields) = key_val { + } else if let value::KeyValue::Struct(fields) = key_val { Self::get_local_key_field(&fields[indices[0] as usize], &indices[1..]) } else { panic!("Only struct can be accessed by sub field"); @@ -196,7 +196,7 @@ impl<'a> ScopeEntry<'a> { ) -> &'b value::Value { if indices.is_empty() { val - } else if let value::Value::Struct(ref fields) = val { + } else if let value::Value::Struct(fields) = val { Self::get_local_field(&fields.fields[indices[0] as usize], &indices[1..]) } else { panic!("Only struct can be accessed by sub field");