Renamed ElementUpdateStrategy to more accurate ContentUpdateStrategy

This commit is contained in:
Philip (a-0) 2024-02-13 18:03:11 +01:00
parent 25570765d7
commit 29d76032cc
7 changed files with 26 additions and 26 deletions

View file

@ -8,13 +8,13 @@ pub struct Element {
pub id: ElementId,
pub pot: Option<PotId>,
pub content: ElementContent,
pub update_strategy: ElementUpdateStrategy,
pub update_strategy: ContentUpdateStrategy,
pub latest_message: Option<MessageId>,
pub local_changes: bool,
}
impl Element {
pub fn new(id: ElementId, content: ElementContent, update_strategy: ElementUpdateStrategy) -> Self {
pub fn new(id: ElementId, content: ElementContent, update_strategy: ContentUpdateStrategy) -> Self {
// A new element with no latest message must have local changes
Element {
id: id,
@ -46,11 +46,11 @@ impl Element {
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ElementUpdateStrategy {
pub enum ContentUpdateStrategy {
Overwrite
}
impl ElementUpdateStrategy {
impl ContentUpdateStrategy {
pub fn default_by_content(&self, content: &ElementContent) -> Self {
match content {
_ => Self::Overwrite,
@ -58,7 +58,7 @@ impl ElementUpdateStrategy {
}
}
impl Default for ElementUpdateStrategy {
impl Default for ContentUpdateStrategy {
fn default() -> Self {
Self::Overwrite
}

View file

@ -8,7 +8,7 @@ mod element_id;
pub use element_id::ElementId;
mod element;
pub use element::{Element, ElementUpdateStrategy};
pub use element::{Element, ContentUpdateStrategy};
mod family_id;
pub use family_id::FamilyId;