zerofrom/lib.rs
1// This file is part of ICU4X. For terms of use, please see the file
2// called LICENSE at the top level of the ICU4X source tree
3// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5//! This crate provides [`ZeroFrom`], a trait for converting types in a zero-copy way.
6//!
7//! See the documentation of [`ZeroFrom`] for more details.
8
9// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
10#![cfg_attr(not(any(test, doc)), no_std)]
11#![cfg_attr(
12 not(test),
13 deny(
14 clippy::indexing_slicing,
15 clippy::unwrap_used,
16 clippy::expect_used,
17 clippy::panic,
18 clippy::exhaustive_structs,
19 clippy::exhaustive_enums,
20 clippy::trivially_copy_pass_by_ref,
21 missing_debug_implementations,
22 )
23)]
24// The lifetimes here are important for safety and explicitly writing
25// them out is good even when redundant
26#![allow(clippy::needless_lifetimes)]
27
28#[cfg(feature = "alloc")]
29extern crate alloc;
30
31mod macro_impls;
32mod zero_from;
33
34#[cfg(feature = "derive")]
35pub use zerofrom_derive::ZeroFrom;
36
37pub use crate::zero_from::ZeroFrom;