Skip to content

Commit

Permalink
Remove some use of unstable features that's meh
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Jan 22, 2024
1 parent 76839f5 commit cf59a96
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ fn print_stats(GeneratorStats { files, dirs, bytes }: GeneratorStats, output: &m

#[cfg_attr(feature = "tracing", tracing::instrument(level = "trace"))]
fn run_generator(config: Configuration) -> Result<GeneratorStats, Error> {
let parallelism =
thread::available_parallelism().unwrap_or(const { NonZeroUsize::new(1).unwrap() });
let parallelism = thread::available_parallelism().unwrap_or(NonZeroUsize::new(1).unwrap());
let mut runtime = tokio::runtime::Builder::new_current_thread();
#[cfg(all(not(miri), target_os = "linux"))]
runtime.on_thread_start(|| {
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![feature(let_chains)]
#![feature(const_option)]
#![feature(inline_const)]

pub use generator::*;

Expand Down
3 changes: 1 addition & 2 deletions src/utils/file_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ pub fn with_file_name<T>(i: u64, f: impl FnOnce(&str) -> T) -> T {
pub fn with_dir_name<T>(i: usize, f: impl FnOnce(&str) -> T) -> T {
const SUFFIX: &str = ".dir";
with_file_name(i.try_into().unwrap(), |s| {
#[allow(clippy::assertions_on_constants)]
const { assert!(usize::BITS <= 128, "Unsupported usize width.") }
const _: () = assert!(usize::BITS <= 128, "Unsupported usize width.");
let mut buf = [MaybeUninit::<u8>::uninit(); 39 + SUFFIX.len()]; // 39 to support u128

unsafe {
Expand Down

0 comments on commit cf59a96

Please sign in to comment.