Fix CI (#58)
* Replace bespoke Error impl with `thiserror` * cargo update * Finix winit version in dev-dependencies
This commit is contained in:
parent
7701ac2d0e
commit
b38363a602
655
Cargo.lock
generated
655
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -23,6 +23,7 @@ travis-ci = { repository = "parasyte/pixels" }
|
||||||
maintenance = { status = "actively-developed" }
|
maintenance = { status = "actively-developed" }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
thiserror = "1.0"
|
||||||
wgpu = "0.4"
|
wgpu = "0.4"
|
||||||
|
|
||||||
# These are only used by the examples, and enabled with features
|
# These are only used by the examples, and enabled with features
|
||||||
|
@ -36,12 +37,12 @@ line_drawing = { version = "0.8", optional = true }
|
||||||
log = { version = "0.4", features = ["release_max_level_warn"], optional = true }
|
log = { version = "0.4", features = ["release_max_level_warn"], optional = true }
|
||||||
randomize = { version = "3.0", optional = true }
|
randomize = { version = "3.0", optional = true }
|
||||||
simple-invaders = { path = "simple-invaders", optional = true }
|
simple-invaders = { path = "simple-invaders", optional = true }
|
||||||
winit = { version = "0.20.0-alpha4", optional = true }
|
winit = { version = "=0.20.0-alpha4", optional = true }
|
||||||
winit_input_helper = { version = "0.4.0-alpha4", optional = true }
|
winit_input_helper = { version = "=0.4.0-alpha4", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pixels-mocks = { path = "pixels-mocks" }
|
pixels-mocks = { path = "pixels-mocks" }
|
||||||
winit = "0.20.0-alpha4"
|
winit = "=0.20.0-alpha4"
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "conway"
|
name = "conway"
|
||||||
|
|
20
src/lib.rs
20
src/lib.rs
|
@ -13,13 +13,12 @@
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::error::Error as StdError;
|
|
||||||
use std::fmt;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
pub use crate::macros::*;
|
pub use crate::macros::*;
|
||||||
pub use crate::render_pass::{BoxedRenderPass, Device, Queue, RenderPass};
|
pub use crate::render_pass::{BoxedRenderPass, Device, Queue, RenderPass};
|
||||||
use crate::renderers::Renderer;
|
use crate::renderers::Renderer;
|
||||||
|
use thiserror::Error;
|
||||||
pub use wgpu;
|
pub use wgpu;
|
||||||
use wgpu::{Extent3d, TextureView};
|
use wgpu::{Extent3d, TextureView};
|
||||||
|
|
||||||
|
@ -71,9 +70,10 @@ pub struct PixelsBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// All the ways in which creating a pixel buffer can fail.
|
/// All the ways in which creating a pixel buffer can fail.
|
||||||
#[derive(Debug)]
|
#[derive(Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// No suitable [`wgpu::Adapter`] found
|
/// No suitable [`wgpu::Adapter`] found
|
||||||
|
#[error("No suitable `wgpu::Adapter` found")]
|
||||||
AdapterNotFound,
|
AdapterNotFound,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,20 +489,6 @@ impl PixelsBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for Error {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
||||||
write!(f, "{}", self.description())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl StdError for Error {
|
|
||||||
fn description(&self) -> &str {
|
|
||||||
match self {
|
|
||||||
Error::AdapterNotFound => "No suitable Adapter found",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_texture_format_size(texture_format: wgpu::TextureFormat) -> u32 {
|
fn get_texture_format_size(texture_format: wgpu::TextureFormat) -> u32 {
|
||||||
match texture_format {
|
match texture_format {
|
||||||
// 8-bit formats
|
// 8-bit formats
|
||||||
|
|
Loading…
Reference in a new issue