Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oxc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ workspace = true

[lib]
test = true
doctest = false
doctest = true

[dependencies]
assert-unchecked = { workspace = true, optional = true }
Expand Down
30 changes: 15 additions & 15 deletions crates/oxc_data_structures/src/code_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use assert_unchecked::assert_unchecked;
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
///
/// // mock settings
Expand Down Expand Up @@ -42,7 +42,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
///
/// // use `code` to build new source text
Expand Down Expand Up @@ -92,7 +92,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// assert!(code.is_empty());
///
Expand All @@ -115,7 +115,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::default();
/// code.reserve(10);
/// ```
Expand All @@ -131,7 +131,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// code.print_str("foo");
///
Expand Down Expand Up @@ -160,7 +160,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// code.print_str("foo");
///
Expand Down Expand Up @@ -194,7 +194,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// code.print_ascii_byte(b'f');
/// code.print_ascii_byte(b'o');
Expand Down Expand Up @@ -234,7 +234,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// // Safe: 'a' is a valid ASCII character. Its UTF-8 representation only
/// // requires a single byte.
Expand Down Expand Up @@ -295,7 +295,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
///
/// code.print_char('f');
Expand All @@ -317,7 +317,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// code.print_str("function main() { console.log('Hello, world!') }");
/// ```
Expand All @@ -333,7 +333,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
///
/// code.print_ascii_bytes([b'f', b'o', b'o']);
Expand Down Expand Up @@ -366,7 +366,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
///
/// // SAFETY: All bytes in this slice are ASCII
Expand Down Expand Up @@ -396,7 +396,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
///
/// // SAFETY: All values yielded by this iterator are ASCII bytes
Expand Down Expand Up @@ -462,7 +462,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// code.print_str("foo");
/// assert_eq!(code.as_bytes(), &[b'f', b'o', b'o']);
Expand All @@ -476,7 +476,7 @@ impl CodeBuffer {
///
/// # Example
/// ```
/// # use oxc_data_structures::CodeBuffer;
/// # use oxc_data_structures::code_buffer::CodeBuffer;
/// let mut code = CodeBuffer::new();
/// code.print_str("console.log('foo');");
///
Expand Down
Loading