Add #![forbid(unsafe_code)] and safety badge

This commit is contained in:
Emil Ernerfeldt 2020-10-18 15:40:23 +02:00
parent b8642b4db4
commit 92cfbe643c
5 changed files with 6 additions and 0 deletions

View file

@ -2,6 +2,7 @@
[![Latest version](https://img.shields.io/crates/v/egui.svg)](https://crates.io/crates/egui) [![Latest version](https://img.shields.io/crates/v/egui.svg)](https://crates.io/crates/egui)
[![Documentation](https://docs.rs/egui/badge.svg)](https://docs.rs/egui) [![Documentation](https://docs.rs/egui/badge.svg)](https://docs.rs/egui)
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg)
![Apache](https://img.shields.io/badge/license-Apache-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg)
@ -54,6 +55,7 @@ Window::new("Debug").show(ui.ctx(), |ui| {
* Simple: no callbacks, minimal dependencies, avoid unnecessary monomorphization * Simple: no callbacks, minimal dependencies, avoid unnecessary monomorphization
* Extensible: [easy to write your own widgets for Egui](https://github.com/emilk/egui/blob/master/egui/src/demos/toggle_switch.rs) * Extensible: [easy to write your own widgets for Egui](https://github.com/emilk/egui/blob/master/egui/src/demos/toggle_switch.rs)
* Modular: You should be able to use small parts of Egui and combine them in new ways * Modular: You should be able to use small parts of Egui and combine them in new ways
* Safe: there is no `unsafe` code in Egui
Egui is *not* a framework. Egui is a library you call into, not an environment you program for. Egui is *not* a framework. Egui is a library you call into, not an environment you program for.

View file

@ -1,3 +1,4 @@
#![forbid(unsafe_code)]
#![deny(warnings)] #![deny(warnings)]
#![warn(clippy::all)] #![warn(clippy::all)]

View file

@ -20,6 +20,7 @@
//! } //! }
//! ``` //! ```
#![forbid(unsafe_code)]
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds #![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
#![warn( #![warn(
clippy::all, clippy::all,

View file

@ -1,3 +1,4 @@
#![forbid(unsafe_code)]
#![deny(warnings)] #![deny(warnings)]
#![warn(clippy::all)] #![warn(clippy::all)]
#![allow(clippy::single_match)] #![allow(clippy::single_match)]

View file

@ -1,3 +1,4 @@
#![forbid(unsafe_code)]
#![deny(warnings)] #![deny(warnings)]
#![warn(clippy::all)] #![warn(clippy::all)]