@@ -2228,7 +2228,7 @@ mod tests {
2228
2228
) ;
2229
2229
assert_matches ! (
2230
2230
policy. annotation( & ast:: AnyId :: new_unchecked( "anno" ) ) ,
2231
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "good annotation" )
2231
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "good annotation" )
2232
2232
) ;
2233
2233
2234
2234
// duplication is error
@@ -2278,28 +2278,28 @@ mod tests {
2278
2278
. get( & ast:: PolicyID :: from_string( "policy0" ) )
2279
2279
. expect( "should be a policy" )
2280
2280
. annotation( & ast:: AnyId :: new_unchecked( "anno1" ) ) ,
2281
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "first" )
2281
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "first" )
2282
2282
) ;
2283
2283
assert_matches ! (
2284
2284
policyset
2285
2285
. get( & ast:: PolicyID :: from_string( "policy1" ) )
2286
2286
. expect( "should be a policy" )
2287
2287
. annotation( & ast:: AnyId :: new_unchecked( "anno2" ) ) ,
2288
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "second" )
2288
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "second" )
2289
2289
) ;
2290
2290
assert_matches ! (
2291
2291
policyset
2292
2292
. get( & ast:: PolicyID :: from_string( "policy2" ) )
2293
2293
. expect( "should be a policy" )
2294
2294
. annotation( & ast:: AnyId :: new_unchecked( "anno3a" ) ) ,
2295
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "third-a" )
2295
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "third-a" )
2296
2296
) ;
2297
2297
assert_matches ! (
2298
2298
policyset
2299
2299
. get( & ast:: PolicyID :: from_string( "policy2" ) )
2300
2300
. expect( "should be a policy" )
2301
2301
. annotation( & ast:: AnyId :: new_unchecked( "anno3b" ) ) ,
2302
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "third-b" )
2302
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "third-b" )
2303
2303
) ;
2304
2304
assert_matches ! (
2305
2305
policyset
@@ -2340,43 +2340,43 @@ mod tests {
2340
2340
. expect ( "should be the right policy ID" ) ;
2341
2341
assert_matches ! (
2342
2342
policy0. annotation( & ast:: AnyId :: new_unchecked( "if" ) ) ,
2343
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `if`" )
2343
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `if`" )
2344
2344
) ;
2345
2345
assert_matches ! (
2346
2346
policy0. annotation( & ast:: AnyId :: new_unchecked( "then" ) ) ,
2347
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `then`" )
2347
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `then`" )
2348
2348
) ;
2349
2349
assert_matches ! (
2350
2350
policy0. annotation( & ast:: AnyId :: new_unchecked( "else" ) ) ,
2351
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `else`" )
2351
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `else`" )
2352
2352
) ;
2353
2353
assert_matches ! (
2354
2354
policy0. annotation( & ast:: AnyId :: new_unchecked( "true" ) ) ,
2355
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `true`" )
2355
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `true`" )
2356
2356
) ;
2357
2357
assert_matches ! (
2358
2358
policy0. annotation( & ast:: AnyId :: new_unchecked( "false" ) ) ,
2359
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `false`" )
2359
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `false`" )
2360
2360
) ;
2361
2361
assert_matches ! (
2362
2362
policy0. annotation( & ast:: AnyId :: new_unchecked( "in" ) ) ,
2363
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `in`" )
2363
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `in`" )
2364
2364
) ;
2365
2365
assert_matches ! (
2366
2366
policy0. annotation( & ast:: AnyId :: new_unchecked( "is" ) ) ,
2367
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `is`" )
2367
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `is`" )
2368
2368
) ;
2369
2369
assert_matches ! (
2370
2370
policy0. annotation( & ast:: AnyId :: new_unchecked( "like" ) ) ,
2371
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `like`" )
2371
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `like`" )
2372
2372
) ;
2373
2373
assert_matches ! (
2374
2374
policy0. annotation( & ast:: AnyId :: new_unchecked( "has" ) ) ,
2375
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `has`" )
2375
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `has`" )
2376
2376
) ;
2377
2377
assert_matches ! (
2378
2378
policy0. annotation( & ast:: AnyId :: new_unchecked( "principal" ) ) ,
2379
- Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_ref ( ) , "this is the annotation for `principal`" )
2379
+ Some ( ast:: Annotation { val, .. } ) => assert_eq!( val. as_str ( ) , "this is the annotation for `principal`" )
2380
2380
) ;
2381
2381
}
2382
2382
0 commit comments