Remove components/nonzero, use std::num::NonZero instead

This commit is contained in:
Simon Sapin 2018-05-24 12:15:12 +02:00
parent d55a003c92
commit e39f741321
15 changed files with 5 additions and 158 deletions

View file

@ -5,9 +5,9 @@
//! The high-level interface from script to constellation. Using this abstract interface helps
//! reduce coupling between these two components.
use nonzero::NonZeroU32;
use std::cell::Cell;
use std::fmt;
use std::num::NonZeroU32;
use webrender_api;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
@ -390,15 +390,11 @@ impl fmt::Display for HistoryStateId {
// We provide ids just for unit testing.
pub const TEST_NAMESPACE: PipelineNamespaceId = PipelineNamespaceId(1234);
#[allow(unsafe_code)]
#[cfg(feature = "unstable")]
pub const TEST_PIPELINE_INDEX: PipelineIndex = unsafe { PipelineIndex(NonZeroU32::new_unchecked(5678)) };
#[cfg(feature = "unstable")]
pub const TEST_PIPELINE_ID: PipelineId = PipelineId { namespace_id: TEST_NAMESPACE, index: TEST_PIPELINE_INDEX };
#[allow(unsafe_code)]
#[cfg(feature = "unstable")]
pub const TEST_BROWSING_CONTEXT_INDEX: BrowsingContextIndex =
unsafe { BrowsingContextIndex(NonZeroU32::new_unchecked(8765)) };
#[cfg(feature = "unstable")]
pub const TEST_BROWSING_CONTEXT_ID: BrowsingContextId =
BrowsingContextId { namespace_id: TEST_NAMESPACE, index: TEST_BROWSING_CONTEXT_INDEX };