From 9017c8db013ac998d964302d2f388d2cb62ce5d6 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Tue, 7 Jul 2020 10:01:53 -0400 Subject: [PATCH] Rustfmt pass --- src/debug.rs | 9 +++------ src/device.rs | 8 ++++---- src/dxgi.rs | 16 +++++----------- src/lib.rs | 5 +---- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/debug.rs b/src/debug.rs index 50f675fa29..5f8445be63 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -1,7 +1,7 @@ use com::WeakPtr; +use winapi::um::d3d12sdklayers; #[cfg(any(feature = "libloading", feature = "implicit-link"))] use winapi::Interface as _; -use winapi::um::d3d12sdklayers; pub type Debug = WeakPtr; @@ -16,14 +16,11 @@ impl crate::D3D12Lib { let mut debug = Debug::null(); let hr = unsafe { let func: libloading::Symbol = self.lib.get(b"D3D12GetDebugInterface")?; - func( - &d3d12sdklayers::ID3D12Debug::uuidof(), - debug.mut_void(), - ) + func(&d3d12sdklayers::ID3D12Debug::uuidof(), debug.mut_void()) }; Ok((debug, hr)) - } + } } impl Debug { diff --git a/src/device.rs b/src/device.rs index 61e2573a03..9a52356509 100644 --- a/src/device.rs +++ b/src/device.rs @@ -9,9 +9,9 @@ use winapi::um::d3d12; use winapi::Interface; use {pso, query, queue}; use { - Blob, CachedPSO, CommandAllocator, CommandQueue, D3DResult, DescriptorHeap, - Fence, GraphicsCommandList, NodeMask, PipelineState, QueryHeap, Resource, RootSignature, - Shader, TextureAddressMode, + Blob, CachedPSO, CommandAllocator, CommandQueue, D3DResult, DescriptorHeap, Fence, + GraphicsCommandList, NodeMask, PipelineState, QueryHeap, Resource, RootSignature, Shader, + TextureAddressMode, }; pub type Device = WeakPtr; @@ -27,7 +27,7 @@ impl crate::D3D12Lib { *mut winapi::um::unknwnbase::IUnknown, winapi::um::d3dcommon::D3D_FEATURE_LEVEL, winapi::shared::guiddef::REFGUID, - *mut *mut winapi::ctypes::c_void, + *mut *mut winapi::ctypes::c_void, ) -> crate::HRESULT; let mut device = Device::null(); diff --git a/src/dxgi.rs b/src/dxgi.rs index dee9a5bca3..2db54049ed 100644 --- a/src/dxgi.rs +++ b/src/dxgi.rs @@ -2,7 +2,7 @@ use com::WeakPtr; use std::ptr; use winapi::shared::windef::HWND; use winapi::shared::{dxgi, dxgi1_2, dxgi1_3, dxgi1_4, dxgiformat, dxgitype}; -use winapi::um::{dxgidebug, d3d12}; +use winapi::um::{d3d12, dxgidebug}; use winapi::Interface; use {CommandQueue, D3DResult, Resource, SampleDesc, HRESULT}; @@ -56,14 +56,12 @@ pub struct DxgiLib { #[cfg(feature = "libloading")] impl DxgiLib { pub fn new() -> Result { - libloading::Library::new("dxgi.dll") - .map(|lib| DxgiLib { - lib, - }) + libloading::Library::new("dxgi.dll").map(|lib| DxgiLib { lib }) } pub fn create_factory2( - &self, flags: FactoryCreationFlags + &self, + flags: FactoryCreationFlags, ) -> Result, libloading::Error> { type Fun = extern "system" fn( winapi::shared::minwindef::UINT, @@ -94,11 +92,7 @@ impl DxgiLib { let mut queue = InfoQueue::null(); let hr = unsafe { let func: libloading::Symbol = self.lib.get(b"DXGIGetDebugInterface1")?; - func( - 0, - &dxgidebug::IDXGIInfoQueue::uuidof(), - queue.mut_void(), - ) + func(0, &dxgidebug::IDXGIInfoQueue::uuidof(), queue.mut_void()) }; Ok((queue, hr)) } diff --git a/src/lib.rs b/src/lib.rs index b18c54c5dd..0fe4702058 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -93,9 +93,6 @@ pub struct D3D12Lib { #[cfg(feature = "libloading")] impl D3D12Lib { pub fn new() -> Result { - libloading::Library::new("d3d12.dll") - .map(|lib| D3D12Lib { - lib, - }) + libloading::Library::new("d3d12.dll").map(|lib| D3D12Lib { lib }) } }