Skip to content

Commit

Permalink
support no-std (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdygert-spok committed Feb 3, 2024
1 parent 3aac584 commit 8bbc58d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_op_in_unsafe_fn)]
#![no_std]

extern crate alloc;

mod raw;

use std::fmt;
use std::ops::Index;
use core::fmt;
use core::ops::Index;

/// Creates a [`Vec`] containing the given elements.
///
Expand Down
12 changes: 7 additions & 5 deletions src/raw.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use std::cell::UnsafeCell;
use std::mem::{self, MaybeUninit};
use std::ops::Index;
use std::sync::atomic::{AtomicBool, AtomicPtr, AtomicU64, AtomicUsize, Ordering};
use std::{ptr, slice};
use core::cell::UnsafeCell;
use core::mem::{self, MaybeUninit};
use core::ops::Index;
use core::sync::atomic::{AtomicBool, AtomicPtr, AtomicU64, AtomicUsize, Ordering};
use core::{ptr, slice};

use alloc::boxed::Box;

const BUCKETS: usize = (usize::BITS as usize) - SKIP_BUCKET;
const MAX_ENTRIES: usize = usize::MAX - SKIP;
Expand Down

0 comments on commit 8bbc58d

Please sign in to comment.