Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name = "cocoindex"
# Will be overridden for specific release versions.
version = "999.0.0"
edition = "2024"
rust-version = "1.86"

[profile.release]
codegen-units = 1
Expand Down
4 changes: 1 addition & 3 deletions src/execution/db_tracking_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ impl ResourceSetupStatus for TrackingTableSetupStatus {
}
}

fn as_any(&self) -> &dyn Any {
self as &dyn Any
}

}

impl TrackingTableSetupStatus {
Expand Down
4 changes: 1 addition & 3 deletions src/ops/factory_bases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,7 @@ impl<T: StorageFactoryBase> ExportTargetFactory for T {
.map(|item| -> anyhow::Result<_> {
Ok(TypedResourceSetupChangeItem {
key: serde_json::from_value(item.key.clone())?,
setup_status: item
.setup_status
.as_any()
setup_status: (item.setup_status as &dyn Any)
.downcast_ref::<T::SetupStatus>()
.ok_or_else(invariance_violation)?,
})
Expand Down
4 changes: 1 addition & 3 deletions src/ops/storages/kuzu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ impl setup::ResourceSetupStatus for GraphElementDataSetupStatus {
self.actions.change_type(false)
}

fn as_any(&self) -> &dyn Any {
self
}

}

fn append_drop_table(
Expand Down
4 changes: 1 addition & 3 deletions src/ops/storages/neo4j.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,7 @@ impl ResourceSetupStatus for GraphElementDataSetupStatus {
self.change_type
}

fn as_any(&self) -> &dyn Any {
self
}

}

async fn clear_graph_element_data(
Expand Down
4 changes: 1 addition & 3 deletions src/ops/storages/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,7 @@ impl setup::ResourceSetupStatus for SetupStatus {
self.actions.table_action.change_type(has_other_update)
}

fn as_any(&self) -> &dyn Any {
self
}

}

impl SetupStatus {
Expand Down
4 changes: 1 addition & 3 deletions src/ops/storages/qdrant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ impl setup::ResourceSetupStatus for SetupStatus {
}
}

fn as_any(&self) -> &dyn Any {
self
}

}

impl SetupStatus {
Expand Down
8 changes: 0 additions & 8 deletions src/setup/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ impl<D: SetupOperator + Send + Sync> ResourceSetupStatus for SetupStatus<D> {
SetupChangeType::Update
}
}

fn as_any(&self) -> &dyn Any {
self
}
}

pub async fn apply_component_changes<D: SetupOperator>(
Expand Down Expand Up @@ -191,8 +187,4 @@ impl<A: ResourceSetupStatus, B: ResourceSetupStatus> ResourceSetupStatus for (A,
(a, _) => a,
}
}

fn as_any(&self) -> &dyn Any {
self
}
}
4 changes: 1 addition & 3 deletions src/setup/db_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,7 @@ impl ResourceSetupStatus for MetadataTableSetup {
}
}

fn as_any(&self) -> &dyn Any {
self as &dyn Any
}

}

impl MetadataTableSetup {
Expand Down
16 changes: 2 additions & 14 deletions src/setup/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::prelude::*;

use indenter::indented;
use owo_colors::{AnsiColors, OwoColorize};
use std::any::Any;
use std::fmt::Debug;
use std::fmt::{Display, Write};
use std::hash::Hash;
Expand Down Expand Up @@ -218,15 +219,10 @@ pub enum SetupChangeType {
Invalid,
}

pub trait ResourceSetupStatus: Send + Sync + Debug + 'static {
pub trait ResourceSetupStatus: Send + Sync + Debug + Any + 'static {
fn describe_changes(&self) -> Vec<String>;

fn change_type(&self) -> SetupChangeType;

// Workaround as Rust doesn't support dyn upcasting before 1.86.
// (https://github.com/rust-lang/rust/issues/65991)
// Can be replaced by a `Any` bound when we require Rust 1.86 or newer.
fn as_any(&self) -> &dyn Any;
}

impl ResourceSetupStatus for Box<dyn ResourceSetupStatus> {
Expand All @@ -237,10 +233,6 @@ impl ResourceSetupStatus for Box<dyn ResourceSetupStatus> {
fn change_type(&self) -> SetupChangeType {
self.as_ref().change_type()
}

fn as_any(&self) -> &dyn Any {
self as &dyn Any
}
}

impl ResourceSetupStatus for std::convert::Infallible {
Expand All @@ -251,10 +243,6 @@ impl ResourceSetupStatus for std::convert::Infallible {
fn change_type(&self) -> SetupChangeType {
unreachable!()
}

fn as_any(&self) -> &dyn Any {
self as &dyn Any
}
}

#[derive(Debug)]
Expand Down
Loading