1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright © 2020 Alexandra Frydl
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

//! Miscellaneous utilities.

mod defer;
mod uuid;

pub use self::defer::{defer, Deferred};
pub use self::uuid::Uuid;
pub use af_core_macros::{attempt, attempt_async};
pub use cfg_if::cfg_if;
pub use futures_lite::pin;
pub use once_cell::sync::Lazy;
pub use pin_project::pin_project;

/// Returns the “default value” for a type.
pub fn default<T: Default>() -> T {
  T::default()
}