~prma/ddd

e82f6f147aa8697337f59c40f4e310fae7239059 — Perma Alesheikh 5 months ago bcacb28
add some logs to the edit implentation of storage

Signed-off-by: Perma Alesheikh <me@prma.dev>
1 files changed, 11 insertions(+), 0 deletions(-)

M src/storage.rs
M src/storage.rs => src/storage.rs +11 -0
@@ 5,6 5,7 @@ use color_eyre::{
    Section,
};
use serde::{Deserialize, Serialize};
use tracing::debug;

use crate::{
    attempt::{self, Attempt, Conclusion},


@@ 133,17 134,27 @@ impl nouns::Repo for &Storage {
        let mut n = self.find_noun_by_id(id)?;

        if let Some(x) = article {
            debug!(
                "editing article. previous: {:#?}, current: {:#?}",
                n.articles, x
            );
            n.articles = x;
        };

        if let Some(x) = word {
            debug!("editing word. previous: {:#?}, current: {:#?}", n.word, x);
            n.word = x;
        };

        if let Some(x) = meaning {
            debug!(
                "editing meaning. previous: {:#?}, current: {:#?}",
                n.meaning, x
            );
            n.meaning = x;
        };
        if let Some(x) = group {
            debug!("editing group. previous: {:#?}, current: {:#?}", n.group, x);
            n.group = x;
        };