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/docs/process/boilerplate.md#library-annotations
10#![cfg_attr(not(test), 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 missing_debug_implementations,
21 )
22)]
23// The lifetimes here are important for safety and explicitly writing
24// them out is good even when redundant
25#![allow(clippy::needless_lifetimes)]
26
27#[cfg(feature = "alloc")]
28extern crate alloc;
29
30mod macro_impls;
31mod zero_from;
32
33#[cfg(feature = "derive")]
34pub use zerofrom_derive::ZeroFrom;
35
36pub use crate::zero_from::ZeroFrom;
37