Skip to content

Commit

Permalink
Remove components/nonzero, use std::num::NonZero instead
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jun 15, 2018
1 parent d55a003 commit e39f741
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 158 deletions.
11 changes: 0 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion components/canvas_traits/Cargo.toml
Expand Up @@ -17,7 +17,6 @@ gleam = "0.5.1"
lazy_static = "1"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
nonzero = {path = "../nonzero"}
offscreen_gl_context = {version = "0.17", features = ["serde"]}
serde = "1.0"
serde_bytes = "0.10"
Expand Down
1 change: 0 additions & 1 deletion components/canvas_traits/lib.rs
Expand Up @@ -14,7 +14,6 @@ extern crate ipc_channel;
#[macro_use] extern crate lazy_static;
extern crate malloc_size_of;
#[macro_use] extern crate malloc_size_of_derive;
extern crate nonzero;
extern crate offscreen_gl_context;
#[macro_use] extern crate serde;
extern crate serde_bytes;
Expand Down
2 changes: 1 addition & 1 deletion components/canvas_traits/webgl.rs
Expand Up @@ -4,9 +4,9 @@

use euclid::Size2D;
use gleam::gl;
use nonzero::NonZeroU32;
use offscreen_gl_context::{GLContextAttributes, GLLimits};
use serde_bytes::ByteBuf;
use std::num::NonZeroU32;
use webrender_api::{DocumentId, ImageKey, PipelineId};

/// Sender type used in WebGLCommands.
Expand Down
1 change: 0 additions & 1 deletion components/compositing/Cargo.toml
Expand Up @@ -24,7 +24,6 @@ libc = "0.2"
log = "0.4"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
nonzero = {path = "../nonzero"}
profile_traits = {path = "../profile_traits"}
script_traits = {path = "../script_traits"}
servo_config = {path = "../config"}
Expand Down
2 changes: 1 addition & 1 deletion components/compositing/compositor.rs
Expand Up @@ -18,7 +18,6 @@ use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
use net_traits::image::base::Image;
#[cfg(feature = "gleam")]
use net_traits::image::base::PixelFormat;
use nonzero::NonZeroU32;
use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::{AnimationState, AnimationTickType, ConstellationMsg, LayoutControlMsg};
use script_traits::{MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId};
Expand All @@ -30,6 +29,7 @@ use std::collections::HashMap;
use std::env;
use std::fs::{File, create_dir_all};
use std::io::Write;
use std::num::NonZeroU32;
use std::rc::Rc;
use std::sync::mpsc::Sender;
use std::time::Instant;
Expand Down
1 change: 0 additions & 1 deletion components/compositing/lib.rs
Expand Up @@ -17,7 +17,6 @@ extern crate libc;
extern crate log;
extern crate msg;
extern crate net_traits;
extern crate nonzero;
extern crate profile_traits;
extern crate script_traits;
extern crate servo_config;
Expand Down
6 changes: 1 addition & 5 deletions components/msg/Cargo.toml
Expand Up @@ -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]
Expand Down
6 changes: 1 addition & 5 deletions components/msg/constellation_msg.rs
Expand Up @@ -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)]
Expand Down Expand Up @@ -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 };

Expand Down
1 change: 0 additions & 1 deletion components/msg/lib.rs
Expand Up @@ -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;

Expand Down
15 changes: 0 additions & 15 deletions components/nonzero/Cargo.toml

This file was deleted.

111 changes: 0 additions & 111 deletions components/nonzero/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion components/remutex/Cargo.toml
Expand Up @@ -14,4 +14,3 @@ doctest = false
[dependencies]
lazy_static = "1"
log = "0.4"
nonzero = {path = "../nonzero"}
3 changes: 1 addition & 2 deletions components/remutex/lib.rs
Expand Up @@ -10,12 +10,11 @@
//! It provides the same interface as https://github.com/rust-lang/rust/blob/master/src/libstd/sys/common/remutex.rs
//! so if those types are ever exported, we should be able to replace this implemtation.

extern crate nonzero;
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate log;

use nonzero::NonZeroUsize;
use std::cell::{Cell, UnsafeCell};
use std::num::NonZeroUsize;
use std::ops::Deref;
use std::sync::{LockResult, Mutex, MutexGuard, PoisonError, TryLockError, TryLockResult};
use std::sync::atomic::{AtomicUsize, Ordering};
Expand Down
1 change: 0 additions & 1 deletion components/servo/Cargo.toml
Expand Up @@ -21,7 +21,6 @@ webrender_debugger = ["webrender/debugger"]
oculusvr = ["webvr/oculusvr"]
unstable = [
"euclid/unstable",
"msg/unstable",
"profile/unstable",
"script/unstable",
]
Expand Down

0 comments on commit e39f741

Please sign in to comment.