File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 11use base64:: encode_config;
22use sha3:: { Digest , Sha3_256 } ;
33
4- /**
5- * Creates a CSS identifier of the given length using SHA3
6- *
7- * In CSS, identifiers (including element names, classes, and IDs in selectors)
8- * can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher,
9- * plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens,
10- * or a hyphen followed by a digit.
11- */
4+ /// Creates a CSS identifier of the given length using SHA3.
5+ ///
6+ /// In CSS, identifiers (including element names, classes, and IDs in
7+ /// selectors) can contain only the characters \[a-zA-Z0-9\] and ISO 10646
8+ /// characters U+00A0 and higher, plus the hyphen (-) and the underscore (_);
9+ /// they cannot start with a digit, two hyphens, or a hyphen followed by a
10+ /// digit.
1211pub fn hash ( data : impl AsRef < [ u8 ] > , length : usize ) -> String {
1312 let mut hasher = Sha3_256 :: new ( ) ;
1413 hasher. update ( data) ;
Original file line number Diff line number Diff line change @@ -52,13 +52,14 @@ impl TransformVisitor {
5252impl VisitMut for TransformVisitor {
5353 noop_visit_mut_type ! ( ) ;
5454
55- /**
56- * Search for all local names for createVar
57- * E.g.:
58- * import { createVar } from "css-variable";
59- * import { createVar as x} from "css-variable";
60- * import { foo as x, createVar as y } from "css-variable";
61- */
55+ /// Searches all local names for `createVar`.
56+ ///
57+ /// For example:
58+ /// ```javascript
59+ /// import { createVar } from "css-variable";
60+ /// import { createVar as x} from "css-variable";
61+ /// import { foo as x, createVar as y } from "css-variable";
62+ /// ```
6263 fn visit_mut_import_decl ( & mut self , import_decl : & mut ImportDecl ) {
6364 if & import_decl. src . value != "css-variable" {
6465 return ;
You can’t perform that action at this time.
0 commit comments