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 3
3
4
4
use crate :: tables:: identifier;
5
5
6
+ pub use identifier:: IdentifierType ;
7
+
6
8
/// Methods for determining characters not restricted from use for identifiers.
7
9
pub trait GeneralSecurityProfile {
8
10
/// Returns whether the character is not restricted from use for identifiers.
9
11
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 > ;
10
15
}
11
16
12
17
impl GeneralSecurityProfile for char {
13
18
#[ inline]
14
19
fn identifier_allowed ( self ) -> bool { identifier:: identifier_status_allowed ( self ) }
15
- }
16
-
17
- impl GeneralSecurityProfile for & ' _ str {
18
20
#[ 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
+
20
23
}
You can’t perform that action at this time.
0 commit comments