@@ -136,17 +136,19 @@ impl Reader {
136
136
Store :: from_stream_async ( format, & mut stream, verify, & mut validation_log) . await
137
137
} ?;
138
138
139
- let /* mut */ result = Self :: from_store ( store, & validation_log) ?;
139
+ #[ allow( unused_mut) ] // TEMPORARY until I figure out the synchronous path.
140
+ let mut result = Self :: from_store ( store, & validation_log) ?;
140
141
if _sync {
141
142
// TO DO: Figure out how to handle synchronous validation with
142
143
// identity assertions? Just report an error (needs async)?
143
144
if false {
144
145
todo ! ( "Add identity assertion validation here" ) ;
145
146
}
146
147
} else {
147
- if true {
148
- todo ! ( "Add identity assertion validation here" ) ;
149
- }
148
+ use crate :: identity:: validator:: CawgValidator ;
149
+ result
150
+ . post_validate_internal_async ( & CawgValidator { } )
151
+ . await ?;
150
152
}
151
153
152
154
Ok ( result)
@@ -752,9 +754,24 @@ impl Reader {
752
754
validator: & impl AsyncPostValidator
753
755
) ) ]
754
756
pub fn post_validate ( & mut self , validator : & impl PostValidator ) -> Result < ( ) > {
755
- if true {
756
- todo ! ( "Remove me" ) ;
757
+ if false {
758
+ // CONSIDER BEFORE MERGING ...
759
+ todo ! ( "Remove me?" ) ;
760
+ }
761
+
762
+ if _sync {
763
+ self . post_validate_internal ( validator)
764
+ } else {
765
+ self . post_validate_internal_async ( validator) . await
757
766
}
767
+ }
768
+
769
+ #[ async_generic( async_signature(
770
+ & mut self ,
771
+ validator: & impl AsyncPostValidator
772
+ ) ) ]
773
+ fn post_validate_internal ( & mut self , validator : & impl PostValidator ) -> Result < ( ) > {
774
+ // TEMPORARY: Make this available while I sort out new code path.
758
775
let mut validation_log = StatusTracker :: default ( ) ;
759
776
let mut validation_results = self . validation_results . take ( ) . unwrap_or_default ( ) ;
760
777
let mut assertion_values = HashMap :: new ( ) ;
@@ -1017,8 +1034,9 @@ pub mod tests {
1017
1034
1018
1035
#[ test]
1019
1036
fn test_reader_post_validate ( ) -> Result < ( ) > {
1020
- if true {
1021
- todo ! ( "Remove me" ) ;
1037
+ if false {
1038
+ // CONSIDER BEFORE MERGING ...
1039
+ todo ! ( "Remove me?" ) ;
1022
1040
}
1023
1041
use crate :: { log_item, status_tracker:: StatusTracker } ;
1024
1042
0 commit comments