Extractor rewrite
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
use serde::Deserialize;
|
||||
use std::{collections::HashMap, fmt::Debug, path::PathBuf};
|
||||
|
||||
mod post;
|
||||
pub use post::*;
|
||||
|
||||
mod misc;
|
||||
pub use misc::*;
|
||||
|
||||
@@ -40,10 +37,6 @@ pub struct DatasetConfig {
|
||||
|
||||
/// Where to find this field
|
||||
pub source: HashMap<Label, Source>,
|
||||
|
||||
/// How to post-process this field
|
||||
#[serde(default)]
|
||||
pub post: Vec<FieldSpecPost>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
@@ -100,10 +93,6 @@ pub struct FieldSpec {
|
||||
|
||||
/// How to find this field in a data entry
|
||||
pub path: Vec<ObjectPath>,
|
||||
|
||||
/// How to post-process this field
|
||||
#[serde(default)]
|
||||
pub post: Vec<FieldSpecPost>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq)]
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
|
||||
#[serde(untagged)]
|
||||
pub enum FieldSpecPost {
|
||||
TrimSuffix { trim_suffix: String },
|
||||
TrimPrefix { trim_prefix: String },
|
||||
SetCase { case: Case },
|
||||
Join { join: String },
|
||||
NotEmpty { notempty: bool },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum Case {
|
||||
Lower,
|
||||
Upper,
|
||||
}
|
||||
Reference in New Issue
Block a user