Skip to content

Commit

Permalink
Fix the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Aug 27, 2024
1 parent 8c987bc commit 19facae
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions src/strip_data.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
use crate::data::{
DataSourceDescription, DataSourceInfo, EntryID, EntryIndex, EntryInfo, Field, ItemLink,
ItemUID, SlotMetaTile, SlotTile, SummaryTile, TileID, DataSource,
DataSource, DataSourceDescription, DataSourceInfo, EntryID, Field, ItemLink, SlotMetaTile,
SlotTile, SummaryTile, TileID,
};

pub struct StripDataSource<T: DataSource> {
data_source: T,
}


impl<T: DataSource> StripDataSource<T> {
pub fn new(data_source: T) -> Self {
Self {
data_source,
}
Self { data_source }
}
}

Expand All @@ -33,21 +30,33 @@ impl<T: DataSource> DataSource for StripDataSource<T> {
self.data_source.fetch_slot_tile(entry_id, tile_id, full)
}

fn fetch_slot_meta_tile(&self, entry_id: &EntryID, tile_id: TileID, full: bool) -> SlotMetaTile {
let mut tile = self.data_source
fn fetch_slot_meta_tile(
&self,
entry_id: &EntryID,
tile_id: TileID,
full: bool,
) -> SlotMetaTile {
let mut tile = self
.data_source
.fetch_slot_meta_tile(entry_id, tile_id, full);
for row in &mut tile.data.items {
for item in row {
item.title = "Redacted".to_string();
for field in item.fields {
for field in &mut item.fields {
match field.1 {
Field::I64(_) => {},
Field::U64(_) => {},
Field::String(x) => { *x = "Redacted".to_string(); },
Field::Interval(_) => {},
Field::ItemLink(ItemLink { title, .. }) => { *title = "Redacted".to_string(); },
Field::Vec(_) => { todo!() },
Field::Empty => {},
Field::I64(_) => {}
Field::U64(_) => {}
Field::String(ref mut x) => {
*x = "Redacted".to_string();
}
Field::Interval(_) => {}
Field::ItemLink(ItemLink { ref mut title, .. }) => {
*title = "Redacted".to_string();
}
Field::Vec(_) => {
todo!()
}
Field::Empty => {}
}
}
}
Expand Down

0 comments on commit 19facae

Please sign in to comment.