mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use NonZeroU32 in canvas_traits
This commit is contained in:
parent
ecf3b05153
commit
5e72173e8c
6 changed files with 16 additions and 5 deletions
|
@ -2,8 +2,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use core::nonzero::NonZero;
|
||||
use euclid::Size2D;
|
||||
use nonzero::NonZeroU32;
|
||||
use offscreen_gl_context::{GLContextAttributes, GLLimits};
|
||||
use std::fmt;
|
||||
use webrender_api;
|
||||
|
@ -242,13 +242,13 @@ pub enum WebGLCommand {
|
|||
macro_rules! define_resource_id_struct {
|
||||
($name:ident) => {
|
||||
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
|
||||
pub struct $name(NonZero<u32>);
|
||||
pub struct $name(NonZeroU32);
|
||||
|
||||
impl $name {
|
||||
#[allow(unsafe_code)]
|
||||
#[inline]
|
||||
pub unsafe fn new(id: u32) -> Self {
|
||||
$name(NonZero::new_unchecked(id))
|
||||
$name(NonZeroU32::new_unchecked(id))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue