-
Notifications
You must be signed in to change notification settings - Fork 109
feat(eap): Track removed keys in EAP trimming processor #5570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
b00033b
6ad3848
9d4d6f6
02601bc
b84d4d4
47a255a
2b4e627
47399dc
858bbb5
772bef6
69a9168
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,10 @@ pub enum ProcessingAction { | |||||
| #[error("value should be hard-deleted (unreachable, should not surface as error!)")] | ||||||
| DeleteValueHard, | ||||||
|
|
||||||
| /// Discards the value entirely, but leaves a remark. | ||||||
| #[error("value should be hard-deleted (unreachable, should not surface as error!)")] | ||||||
| DeleteValueFirm, | ||||||
|
||||||
| DeleteValueFirm, | |
| DeleteValueWithRemark, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, "Firm" was fully intended as a placeholder name.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; | |||||
| use crate::meta::{Error, Meta}; | ||||||
| use crate::traits::{Empty, FromValue, IntoValue, SkipSerialization}; | ||||||
| use crate::value::{Map, Value}; | ||||||
| use crate::{Remark, RemarkType}; | ||||||
|
|
||||||
| /// Represents a tree of meta objects. | ||||||
| #[derive(Default, Debug, Serialize)] | ||||||
|
|
@@ -236,6 +237,25 @@ impl<T> Annotated<T> { | |||||
|
|
||||||
| other() | ||||||
| } | ||||||
|
|
||||||
| pub fn delete_hard(&mut self) { | ||||||
| self.0 = None; | ||||||
| } | ||||||
loewenheim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| pub fn delete_firm(&mut self) { | ||||||
| self.0 = None; | ||||||
| self.1.add_remark(Remark { | ||||||
| ty: RemarkType::Removed, | ||||||
| rule_id: "delete_firm".to_owned(), | ||||||
|
||||||
| rule_id: "delete_firm".to_owned(), | |
| rule_id: "trimmed".to_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's no way around this
to_owned; we need the key to be detached from the map or we can't modify it.