Skip to content

Commit

Permalink
docs: ✏️ use oxc_index
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY authored and Boshen committed Sep 3, 2024
1 parent 0a5780d commit 8ffc92b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_index/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//!
//! ## Example / Overview
//! ```rust
//! use index_vec::{IndexVec, IndexSlice, index_vec};
//! use oxc_index::{IndexVec, IndexSlice, index_vec};
//!
//! index_vec::define_index_type! {
//! oxc_index::define_index_type! {
//! // Define StrIdx to use only 32 bits internally (you can use usize, u16,
//! // and even u8).
//! pub struct StrIdx = u32;
Expand Down
12 changes: 6 additions & 6 deletions crates/oxc_index/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// The rough usage pattern of this macro is:
///
/// ```rust,no_run
/// index_vec::define_index_type! {
/// oxc_index::define_index_type! {
/// // Note that isn't actually a type alias, `MyIndex` is
/// // actually defined as a struct. XXX is this too confusing?
/// pub struct MyIndex = u32;
Expand All @@ -31,7 +31,7 @@
/// the macro uses to customize how the type it generates behaves. For example:
///
/// ```rust,no_run
/// index_vec::define_index_type! {
/// oxc_index::define_index_type! {
/// pub struct Span = u32;
///
/// // Don't allow any spans with values higher this.
Expand Down Expand Up @@ -83,7 +83,7 @@
/// Example:
///
/// ```rust,no_run
/// index_vec::define_index_type! {
/// oxc_index::define_index_type! {
/// pub struct MyIdx = u16;
/// MAX_INDEX = (u16::max_value() - 1) as usize;
/// // Set the default index to be an invalid index, as
Expand All @@ -101,7 +101,7 @@
/// the index. This can be done via `DEBUG_FORMAT`:
///
/// ```rust
/// index_vec::define_index_type! {
/// oxc_index::define_index_type! {
/// struct FooIdx = usize;
/// DEBUG_FORMAT = "Foo({})";
/// }
Expand All @@ -119,7 +119,7 @@
/// the index type.
///
/// ```rust
/// index_vec::define_index_type! {
/// oxc_index::define_index_type! {
/// struct FooIdx = usize;
/// DISPLAY_FORMAT = "{}";
/// // Note that you can use both DEBUG_FORMAT and DISPLAY_FORMAT.
Expand All @@ -141,7 +141,7 @@
/// via this option. It's an error to use this if your raw type is usize.
///
/// ```rust
/// index_vec::define_index_type! {
/// oxc_index::define_index_type! {
/// struct FooIdx = u32;
/// IMPL_RAW_CONVERSIONS = true;
/// }
Expand Down

0 comments on commit 8ffc92b

Please sign in to comment.