This commit is contained in:
adamnemecek 2021-08-20 19:36:06 -07:00
parent 62f26367cd
commit efd52e02af
6 changed files with 15 additions and 15 deletions

View File

@ -20,7 +20,7 @@ mod compat {
}
impl<T> Default for Entry<T> {
fn default() -> Self {
Entry {
Self {
assigned: None,
expected: None,
}
@ -43,7 +43,7 @@ mod compat {
impl<T: Copy + PartialEq> Manager<T> {
pub fn new() -> Self {
Manager {
Self {
entries: Default::default(),
}
}
@ -146,7 +146,7 @@ pub(super) struct Binder {
impl Binder {
pub(super) fn new() -> Self {
Binder {
Self {
pipeline_layout_id: None,
manager: compat::Manager::new(),
payloads: Default::default(),

View File

@ -222,8 +222,8 @@ enum OptionalState {
impl OptionalState {
fn require(&mut self, require: bool) {
if require && *self == OptionalState::Unused {
*self = OptionalState::Required;
if require && *self == Self::Unused {
*self = Self::Required;
}
}
}
@ -268,7 +268,7 @@ struct VertexBufferState {
}
impl VertexBufferState {
const EMPTY: Self = VertexBufferState {
const EMPTY: Self = Self {
total_size: 0,
stride: 0,
rate: VertexStepMode::Vertex,

View File

@ -84,7 +84,7 @@ impl RenderPassContext {
// Assumed the renderpass only contains one subpass
pub(crate) fn check_compatible(
&self,
other: &RenderPassContext,
other: &Self,
) -> Result<(), RenderPassCompatibilityError> {
if self.attachments.colors != other.attachments.colors {
return Err(RenderPassCompatibilityError::IncompatibleColorAttachment(
@ -119,7 +119,7 @@ pub struct UserClosures {
}
impl UserClosures {
fn extend(&mut self, other: UserClosures) {
fn extend(&mut self, other: Self) {
self.mappings.extend(other.mappings);
self.submissions.extend(other.submissions);
}

View File

@ -170,9 +170,9 @@ pub(crate) enum TextureInner<A: hal::Api> {
impl<A: hal::Api> TextureInner<A> {
pub fn as_raw(&self) -> Option<&A::Texture> {
match *self {
TextureInner::Native { raw: Some(ref tex) } => Some(tex),
TextureInner::Native { raw: None } => None,
TextureInner::Surface {
Self::Native { raw: Some(ref tex) } => Some(tex),
Self::Native { raw: None } => None,
Self::Surface {
ref raw,
parent_id: _,
} => Some(std::borrow::Borrow::borrow(raw)),

View File

@ -923,7 +923,7 @@ impl Interface {
entry_points.insert((entry_point.stage, entry_point.name.clone()), ep);
}
Interface {
Self {
features,
resources,
entry_points,

View File

@ -545,7 +545,7 @@ struct MapContext {
impl MapContext {
fn new(total_size: BufferAddress) -> Self {
MapContext {
Self {
total_size,
initial_range: 0..0,
sub_ranges: Vec::new(),
@ -1383,7 +1383,7 @@ impl Instance {
/// - `backends` - Controls from which [backends][Backends] wgpu will choose
/// during instantiation.
pub fn new(backends: Backends) -> Self {
Instance {
Self {
context: Arc::new(C::init(backends)),
}
}
@ -1399,7 +1399,7 @@ impl Instance {
/// Refer to the creation of wgpu-hal Instance for every backend.
#[cfg(not(target_arch = "wasm32"))]
pub unsafe fn from_hal<A: wgc::hub::HalApi>(hal_instance: A::Instance) -> Self {
Instance {
Self {
context: Arc::new(C::from_hal_instance::<A>(hal_instance)),
}
}