File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 33
44use crate :: tables:: identifier;
55
6+ pub use identifier:: IdentifierType ;
7+
68/// Methods for determining characters not restricted from use for identifiers.
79pub trait GeneralSecurityProfile {
810 /// Returns whether the character is not restricted from use for identifiers.
911 fn identifier_allowed ( self ) -> bool ;
12+
13+ /// Returns the [identifier type](https://www.unicode.org/reports/tr39/#Identifier_Status_and_Type)
14+ fn identifier_type ( self ) -> Option < IdentifierType > ;
1015}
1116
1217impl GeneralSecurityProfile for char {
1318 #[ inline]
1419 fn identifier_allowed ( self ) -> bool { identifier:: identifier_status_allowed ( self ) }
15- }
16-
17- impl GeneralSecurityProfile for & ' _ str {
1820 #[ inline]
19- fn identifier_allowed ( self ) -> bool { self . chars ( ) . all ( identifier:: identifier_status_allowed) }
21+ fn identifier_type ( self ) -> Option < IdentifierType > { identifier:: identifier_type ( self ) }
22+
2023}
You can’t perform that action at this time.
0 commit comments