@@ -697,7 +697,7 @@ impl Entities {
697
697
/// "parents": [{"type":"Group","id":"admin"}]
698
698
/// },
699
699
/// {
700
- /// "uid": {"type":"Groupd ","id":"admin"},
700
+ /// "uid": {"type":"Group ","id":"admin"},
701
701
/// "attrs": {},
702
702
/// "parents": []
703
703
/// }
@@ -2916,15 +2916,15 @@ impl Template {
2916
2916
2917
2917
/// Get an annotation value of this `Template`.
2918
2918
/// If the annotation is present without an explicit value (e.g., `@annotation`),
2919
- /// then this function returns `Some("")`. It returns `None` only when the
2920
- /// annotation is not present.
2919
+ /// then this function returns `Some("")`. Returns `None` when the
2920
+ /// annotation is not present or when `key` is not a valid annotation identifier .
2921
2921
pub fn annotation ( & self , key : impl AsRef < str > ) -> Option < & str > {
2922
2922
self . ast
2923
2923
. annotation ( & key. as_ref ( ) . parse ( ) . ok ( ) ?)
2924
2924
. map ( AsRef :: as_ref)
2925
2925
}
2926
2926
2927
- /// Iterate through annotation data of this `Template` as key-value pairs
2927
+ /// Iterate through annotation data of this `Template` as key-value pairs.
2928
2928
/// Annotations which do not have an explicit value (e.g., `@annotation`),
2929
2929
/// are included in the iterator with the value `""`.
2930
2930
pub fn annotations ( & self ) -> impl Iterator < Item = ( & str , & str ) > {
@@ -3255,17 +3255,17 @@ impl Policy {
3255
3255
self . ast . effect ( )
3256
3256
}
3257
3257
3258
- /// Get an annotation value of this template-linked or static policy
3258
+ /// Get an annotation value of this template-linked or static policy.
3259
3259
/// If the annotation is present without an explicit value (e.g., `@annotation`),
3260
- /// then this function returns `Some("")`. It returns `None` only when the
3261
- /// annotation is not present.
3260
+ /// then this function returns `Some("")`. Returns `None` when the
3261
+ /// annotation is not present or when `key` is not a valid annotations identifier .
3262
3262
pub fn annotation ( & self , key : impl AsRef < str > ) -> Option < & str > {
3263
3263
self . ast
3264
3264
. annotation ( & key. as_ref ( ) . parse ( ) . ok ( ) ?)
3265
3265
. map ( AsRef :: as_ref)
3266
3266
}
3267
3267
3268
- /// Iterate through annotation data of this template-linked or static policy
3268
+ /// Iterate through annotation data of this template-linked or static policy.
3269
3269
/// Annotations which do not have an explicit value (e.g., `@annotation`),
3270
3270
/// are included in the iterator with the value `""`.
3271
3271
pub fn annotations ( & self ) -> impl Iterator < Item = ( & str , & str ) > {
0 commit comments