mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace NonZeroU32 and NonZeroUsize with a generic NonZero
The API is identical to core::nonzero::NonZero
This commit is contained in:
parent
4ee1b26b6c
commit
9e4865b6c8
7 changed files with 115 additions and 67 deletions
|
@ -13,7 +13,7 @@ use image::{DynamicImage, ImageFormat, RgbImage};
|
|||
use ipc_channel::ipc::{self, IpcSharedMemory};
|
||||
use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
|
||||
use net_traits::image::base::{Image, PixelFormat};
|
||||
use nonzero::NonZeroU32;
|
||||
use nonzero::NonZero;
|
||||
use profile_traits::time::{self, ProfilerCategory, profile};
|
||||
use script_traits::{AnimationState, AnimationTickType, ConstellationControlMsg};
|
||||
use script_traits::{ConstellationMsg, LayoutControlMsg, MouseButton};
|
||||
|
@ -62,7 +62,7 @@ impl ConvertPipelineIdFromWebRender for webrender_api::PipelineId {
|
|||
fn from_webrender(&self) -> PipelineId {
|
||||
PipelineId {
|
||||
namespace_id: PipelineNamespaceId(self.0),
|
||||
index: PipelineIndex(NonZeroU32::new(self.1).expect("Webrender pipeline zero?")),
|
||||
index: PipelineIndex(NonZero::new(self.1).expect("Webrender pipeline zero?")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue