fix warnings/errors (#1692)

This commit is contained in:
Austin Johnson 2021-09-04 01:41:17 -05:00 committed by GitHub
parent f186ef80a5
commit 588f91dc59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 9 deletions

View File

@ -160,7 +160,8 @@ fn main() {
let png_bytes = include_bytes!("image_img.png").to_vec();
let cursor = Cursor::new(png_bytes);
let decoder = png::Decoder::new(cursor);
let (info, mut reader) = decoder.read_info().unwrap();
let mut reader = decoder.read_info().unwrap();
let info = reader.info();
let dimensions = ImageDimensions::Dim2d {
width: info.width,
height: info.height,

View File

@ -1,8 +1,6 @@
use std::borrow::Borrow;
use std::error;
use std::fmt;
#[cfg(target_os = "windows")]
use std::ptr;
use std::rc::Rc;
use std::sync::Arc;

View File

@ -31,18 +31,28 @@ use crate::memory::pool::MemoryPoolAlloc;
use crate::memory::pool::PotentialDedicatedAllocation;
use crate::memory::pool::StdMemoryPoolAlloc;
use crate::memory::{DedicatedAlloc, MemoryRequirements};
use crate::memory::{DeviceMemoryAllocError, ExternalMemoryHandleType};
use crate::memory::DeviceMemoryAllocError;
use crate::sync::AccessError;
use crate::sync::Sharing;
use crate::DeviceSize;
use smallvec::SmallVec;
use std::fs::File;
use std::hash::Hash;
use std::hash::Hasher;
use std::marker::PhantomData;
use std::mem;
use std::sync::Arc;
use std::sync::Mutex;
#[cfg(any(
target_os = "linux",
target_os = "dragonflybsd",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
use {
crate::memory::ExternalMemoryHandleType,
std::fs::File
};
/// Buffer whose content is in device-local memory.
///

View File

@ -304,11 +304,8 @@ impl From<OomError> for SemaphoreError {
#[cfg(test)]
mod tests {
use crate::device::physical::PhysicalDevice;
use crate::device::{Device, DeviceExtensions};
use crate::instance::{Instance, InstanceExtensions};
use crate::VulkanObject;
use crate::{sync::Semaphore, Version};
use crate::sync::Semaphore;
#[test]
fn semaphore_create() {
@ -342,6 +339,11 @@ mod tests {
target_os = "openbsd"
))]
fn semaphore_export() {
use crate::device::physical::PhysicalDevice;
use crate::device::{Device, DeviceExtensions};
use crate::instance::{Instance, InstanceExtensions};
use crate::Version;
let supported_ext = InstanceExtensions::supported_by_core().unwrap();
if supported_ext.khr_get_display_properties2
&& supported_ext.khr_external_semaphore_capabilities