Rollup merge of #76481 - moonheart08:vec_deque_constify, r=sfackler

Convert repetitive target_pointer_width checks to const solution.

Simply a quick code tidying change. Not sure if more needs to be said.
This commit is contained in:
Tyler Mandry 2020-09-09 15:05:56 -07:00 committed by GitHub
commit 0d20cf8568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,12 +32,8 @@ mod tests;
const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
const MINIMUM_CAPACITY: usize = 1; // 2 - 1
#[cfg(target_pointer_width = "16")]
const MAXIMUM_ZST_CAPACITY: usize = 1 << (16 - 1); // Largest possible power of two
#[cfg(target_pointer_width = "32")]
const MAXIMUM_ZST_CAPACITY: usize = 1 << (32 - 1); // Largest possible power of two
#[cfg(target_pointer_width = "64")]
const MAXIMUM_ZST_CAPACITY: usize = 1 << (64 - 1); // Largest possible power of two
const MAXIMUM_ZST_CAPACITY: usize = 1 << (core::mem::size_of::<usize>() * 8 - 1); // Largest possible power of two
/// A double-ended queue implemented with a growable ring buffer.
///