Switch to a new ActivityTree implementation.
This new implementation explicitly tracks the children of each node, eliminating many iterations through the full tree.
This commit is contained in:
@@ -3,6 +3,9 @@ use std::num::TryFromIntError;
|
||||
use std::str::Utf8Error;
|
||||
use std::string::FromUtf8Error;
|
||||
|
||||
use crate::nix_util::ActivityIdAlreadyInTreeError;
|
||||
use crate::nix_util::ActivityIdNotInTreeError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum CustomError {
|
||||
Static(#[allow(dead_code)] &'static str),
|
||||
@@ -19,6 +22,8 @@ pub(crate) enum CustomError {
|
||||
Migrate(#[allow(dead_code)] sqlx::migrate::MigrateError),
|
||||
Sql(#[allow(dead_code)] sqlx::Error),
|
||||
TryFromIntError(#[allow(dead_code)] TryFromIntError),
|
||||
ActivityIdNotInTreeError(#[allow(dead_code)] ActivityIdNotInTreeError),
|
||||
ActivityIdAlreadyInTreeError(#[allow(dead_code)] ActivityIdAlreadyInTreeError),
|
||||
}
|
||||
|
||||
impl Display for CustomError {
|
||||
@@ -110,3 +115,15 @@ impl From<TryFromIntError> for CustomError {
|
||||
CustomError::TryFromIntError(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ActivityIdNotInTreeError> for CustomError {
|
||||
fn from(value: ActivityIdNotInTreeError) -> Self {
|
||||
CustomError::ActivityIdNotInTreeError(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ActivityIdAlreadyInTreeError> for CustomError {
|
||||
fn from(value: ActivityIdAlreadyInTreeError) -> Self {
|
||||
CustomError::ActivityIdAlreadyInTreeError(value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user