oxc/crates/oxc_span/src/lib.rs
overlookmotel 8001b2f796
refactor: make CompactStr immutable (#2620)
First step towards #2516.

This replaces `compact_str::CompactString` with an immutable interface `CompactStr`.

Currently just implemented as a wrapper around `CompactString` which hides all its mutation methods. A more optimized implementation to follow, which shrinks size of `CompactStr` to 16 bytes by removing the `capacity` field.

The rationale for the change of name is: `CompactString` is like `String` in that it's mutable. `CompactStr` is more like `str` - immutable - so its name mirrors `str`.
2024-03-06 12:29:32 +08:00

13 lines
366 B
Rust

//! Source positions and related helper functions.
//!
//! <https://doc.rust-lang.org/beta/nightly-rustc/rustc_span>
mod atom;
mod source_type;
mod span;
pub use crate::{
atom::{Atom, CompactStr, MAX_INLINE_LEN as ATOM_MAX_INLINE_LEN},
source_type::{Language, LanguageVariant, ModuleKind, SourceType, VALID_EXTENSIONS},
span::{GetSpan, Span, SPAN},
};