Skip to content

Commit 9b12398

Browse files
committed
Switch to rustdoc
1 parent 1e792ee commit 9b12398

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

swc/src/hash.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
use base64::encode_config;
22
use 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.
1211
pub fn hash(data: impl AsRef<[u8]>, length: usize) -> String {
1312
let mut hasher = Sha3_256::new();
1413
hasher.update(data);

swc/src/lib.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ impl TransformVisitor {
5252
impl 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;

0 commit comments

Comments
 (0)