1
1
use crate :: data:: {
2
- DataSourceDescription , DataSourceInfo , EntryID , EntryIndex , EntryInfo , Field , ItemLink ,
3
- ItemUID , SlotMetaTile , SlotTile , SummaryTile , TileID , DataSource ,
2
+ DataSource , DataSourceDescription , DataSourceInfo , EntryID , Field , ItemLink , SlotMetaTile ,
3
+ SlotTile , SummaryTile , TileID ,
4
4
} ;
5
5
6
6
pub struct StripDataSource < T : DataSource > {
7
7
data_source : T ,
8
8
}
9
9
10
-
11
10
impl < T : DataSource > StripDataSource < T > {
12
11
pub fn new ( data_source : T ) -> Self {
13
- Self {
14
- data_source,
15
- }
12
+ Self { data_source }
16
13
}
17
14
}
18
15
@@ -33,21 +30,33 @@ impl<T: DataSource> DataSource for StripDataSource<T> {
33
30
self . data_source . fetch_slot_tile ( entry_id, tile_id, full)
34
31
}
35
32
36
- fn fetch_slot_meta_tile ( & self , entry_id : & EntryID , tile_id : TileID , full : bool ) -> SlotMetaTile {
37
- let mut tile = self . data_source
33
+ fn fetch_slot_meta_tile (
34
+ & self ,
35
+ entry_id : & EntryID ,
36
+ tile_id : TileID ,
37
+ full : bool ,
38
+ ) -> SlotMetaTile {
39
+ let mut tile = self
40
+ . data_source
38
41
. fetch_slot_meta_tile ( entry_id, tile_id, full) ;
39
42
for row in & mut tile. data . items {
40
43
for item in row {
41
44
item. title = "Redacted" . to_string ( ) ;
42
- for field in item. fields {
45
+ for field in & mut item. fields {
43
46
match field. 1 {
44
- Field :: I64 ( _) => { } ,
45
- Field :: U64 ( _) => { } ,
46
- Field :: String ( x) => { * x = "Redacted" . to_string ( ) ; } ,
47
- Field :: Interval ( _) => { } ,
48
- Field :: ItemLink ( ItemLink { title, .. } ) => { * title = "Redacted" . to_string ( ) ; } ,
49
- Field :: Vec ( _) => { todo ! ( ) } ,
50
- Field :: Empty => { } ,
47
+ Field :: I64 ( _) => { }
48
+ Field :: U64 ( _) => { }
49
+ Field :: String ( ref mut x) => {
50
+ * x = "Redacted" . to_string ( ) ;
51
+ }
52
+ Field :: Interval ( _) => { }
53
+ Field :: ItemLink ( ItemLink { ref mut title, .. } ) => {
54
+ * title = "Redacted" . to_string ( ) ;
55
+ }
56
+ Field :: Vec ( _) => {
57
+ todo ! ( )
58
+ }
59
+ Field :: Empty => { }
51
60
}
52
61
}
53
62
}
0 commit comments