Skip to content

Commit

Permalink
Forbid unsafe code (#399)
Browse files Browse the repository at this point in the history
* Forbid unsafe code

- Made possible by `wgpu` 0.19: https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#safe--unified-surface-creation
- Closes #238

* Add safety dance badge
  • Loading branch information
parasyte authored Sep 22, 2024
1 parent ee9b4ea commit 57d339e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Crates.io](https://img.shields.io/crates/v/pixels)](https://crates.io/crates/pixels "Crates.io version")
[![Documentation](https://img.shields.io/docsrs/pixels)](https://docs.rs/pixels "Documentation")
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
[![GitHub actions](https://img.shields.io/github/actions/workflow/status/parasyte/pixels/ci.yml?branch=main)](https://github.com/parasyte/pixels/actions "CI")
[![GitHub activity](https://img.shields.io/github/last-commit/parasyte/pixels)](https://github.com/parasyte/pixels/commits "Commit activity")
[![GitHub Sponsors](https://img.shields.io/github/sponsors/parasyte)](https://github.com/sponsors/parasyte "Sponsors")
Expand Down
3 changes: 3 additions & 0 deletions examples/minimal-winit-android/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#![deny(clippy::all)]
#![forbid(unsafe_code)]

#[cfg(target_os = "android")]
use winit::platform::android::activity::AndroidApp;

Expand Down
1 change: 1 addition & 0 deletions internals/pixels-mocks/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(clippy::all)]
#![forbid(unsafe_code)]

pub struct Window;

Expand Down
3 changes: 3 additions & 0 deletions run-wasm/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#![deny(clippy::all)]
#![forbid(unsafe_code)]

fn main() {
let css = r#"body {
background-color: #000;
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
//! `WGPU_ADAPTER_NAME` takes precedence.

#![deny(clippy::all)]
#![forbid(unsafe_code)]

pub use crate::builder::{check_texture_size, PixelsBuilder};
pub use crate::renderers::ScalingRenderer;
Expand Down

0 comments on commit 57d339e

Please sign in to comment.