Skip to content

Commit 18c579f

Browse files
authored
chore(rust-lang): switch Rust edition from 2021 to 2024 (#488)
1 parent a29b59a commit 18c579f

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "cocoindex"
33
# Version used for local development is always higher than others to take precedence.
44
# Will be overridden for specific release versions.
55
version = "999.0.0"
6-
edition = "2021"
6+
edition = "2024"
77

88
[profile.release]
99
codegen-units = 1

src/builder/analyzed_flow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{ops::interface::FlowInstanceContext, prelude::*};
33
use super::{analyzer, plan};
44
use crate::{
55
ops::registry::ExecutorFactoryRegistry,
6-
service::error::{shared_ok, SharedError, SharedResultExt},
6+
service::error::{SharedError, SharedResultExt, shared_ok},
77
setup::{self, ObjectSetupStatus},
88
};
99

src/builder/analyzer.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use crate::{
1212
base::{schema::*, spec::*},
1313
ops::{interface::*, registry::*},
1414
};
15-
use futures::future::{try_join3, BoxFuture};
16-
use futures::{future::try_join_all, FutureExt};
15+
use futures::future::{BoxFuture, try_join3};
16+
use futures::{FutureExt, future::try_join_all};
1717

1818
#[derive(Debug)]
1919
pub(super) enum ValueTypeBuilder {
@@ -668,15 +668,15 @@ impl AnalyzerContext<'_> {
668668
import_op: NamedSpec<ImportOpSpec>,
669669
metadata: Option<&mut FlowSetupMetadata>,
670670
existing_source_states: Option<&Vec<&SourceSetupState>>,
671-
) -> Result<impl Future<Output = Result<AnalyzedImportOp>> + Send> {
671+
) -> Result<impl Future<Output = Result<AnalyzedImportOp>> + Send + use<>> {
672672
let factory = self.registry.get(&import_op.spec.source.kind);
673673
let source_factory = match factory {
674674
Some(ExecutorFactory::Source(source_executor)) => source_executor.clone(),
675675
_ => {
676676
return Err(anyhow::anyhow!(
677677
"Source executor not found for kind: {}",
678678
import_op.spec.source.kind
679-
))
679+
));
680680
}
681681
};
682682
let (output_type, executor) = source_factory.build(
@@ -817,7 +817,7 @@ impl AnalyzerContext<'_> {
817817
return Err(anyhow::anyhow!(
818818
"Transform op kind not found: {}",
819819
op.op.kind
820-
))
820+
));
821821
}
822822
}
823823
}
@@ -967,7 +967,7 @@ impl AnalyzerContext<'_> {
967967
declarations: Vec<serde_json::Value>,
968968
flow_setup_state: &mut FlowSetupState<DesiredMode>,
969969
existing_target_states: &HashMap<&ResourceIdentifier, Vec<&TargetSetupState>>,
970-
) -> Result<Vec<impl Future<Output = Result<AnalyzedExportOp>> + Send>> {
970+
) -> Result<Vec<impl Future<Output = Result<AnalyzedExportOp>> + Send + use<>>> {
971971
let mut collection_specs = Vec::<interface::ExportDataCollectionSpec>::new();
972972
let mut data_fields_infos = Vec::<ExportDataFieldsInfo>::new();
973973
for idx in export_op_group.op_idx.iter() {
@@ -1104,7 +1104,7 @@ impl AnalyzerContext<'_> {
11041104
&self,
11051105
op_scope: &Arc<OpScope>,
11061106
reactive_ops: &[NamedSpec<ReactiveOpSpec>],
1107-
) -> Result<impl Future<Output = Result<AnalyzedOpScope>> + Send> {
1107+
) -> Result<impl Future<Output = Result<AnalyzedOpScope>> + Send + use<>> {
11081108
let op_futs = reactive_ops
11091109
.iter()
11101110
.map(|reactive_op| self.analyze_reactive_op(op_scope, reactive_op))
@@ -1147,7 +1147,7 @@ pub fn analyze_flow(
11471147
registry: &ExecutorFactoryRegistry,
11481148
) -> Result<(
11491149
FlowSchema,
1150-
impl Future<Output = Result<ExecutionPlan>> + Send,
1150+
impl Future<Output = Result<ExecutionPlan>> + Send + use<>,
11511151
setup::FlowSetupState<setup::DesiredMode>,
11521152
)> {
11531153
let existing_metadata_versions = || {

src/execution/evaluator.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
use std::sync::{Mutex, OnceLock};
22
use std::{borrow::Cow, collections::BTreeMap};
33

4-
use anyhow::{bail, Context, Ok, Result};
4+
use anyhow::{Context, Ok, Result, bail};
55
use futures::future::try_join_all;
66

7-
use crate::builder::{plan::*, AnalyzedTransientFlow};
7+
use crate::builder::{AnalyzedTransientFlow, plan::*};
88
use crate::py::IntoPyResult;
99
use crate::{
1010
base::{schema, value},
1111
utils::immutable::RefList,
1212
};
1313

14-
use super::memoization::{evaluate_with_cell, EvaluationMemory, EvaluationMemoryOptions};
14+
use super::memoization::{EvaluationMemory, EvaluationMemoryOptions, evaluate_with_cell};
1515

1616
#[derive(Debug)]
1717
pub struct ScopeValueBuilder {
@@ -183,7 +183,7 @@ impl<'a> ScopeEntry<'a> {
183183
) -> &'b value::KeyValue {
184184
if indices.is_empty() {
185185
key_val
186-
} else if let value::KeyValue::Struct(ref fields) = key_val {
186+
} else if let value::KeyValue::Struct(fields) = key_val {
187187
Self::get_local_key_field(&fields[indices[0] as usize], &indices[1..])
188188
} else {
189189
panic!("Only struct can be accessed by sub field");
@@ -196,7 +196,7 @@ impl<'a> ScopeEntry<'a> {
196196
) -> &'b value::Value<ScopeValueBuilder> {
197197
if indices.is_empty() {
198198
val
199-
} else if let value::Value::Struct(ref fields) = val {
199+
} else if let value::Value::Struct(fields) = val {
200200
Self::get_local_field(&fields.fields[indices[0] as usize], &indices[1..])
201201
} else {
202202
panic!("Only struct can be accessed by sub field");

0 commit comments

Comments
 (0)