mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Remove components/nonzero, use std::num::NonZero instead
This commit is contained in:
parent
d55a003c92
commit
e39f741321
15 changed files with 5 additions and 158 deletions
|
@ -11,15 +11,11 @@ path = "lib.rs"
|
|||
test = false
|
||||
doctest = false
|
||||
|
||||
[features]
|
||||
unstable = ["nonzero/unstable"]
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
malloc_size_of = { path = "../malloc_size_of" }
|
||||
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
|
||||
nonzero = {path = "../nonzero"}
|
||||
serde = "1.0.14"
|
||||
serde = "1.0.60"
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -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 };
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
extern crate bitflags;
|
||||
#[macro_use] extern crate malloc_size_of;
|
||||
#[macro_use] extern crate malloc_size_of_derive;
|
||||
extern crate nonzero;
|
||||
#[macro_use] extern crate serde;
|
||||
extern crate webrender_api;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue