From cb889cd5e6be2f85bf069d26b307edf9da584c93 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 31 Jul 2024 08:49:28 -0400 Subject: [PATCH] fix rustfmt --- core/src/coproduct.rs | 2 +- core/src/hlist.rs | 4 ++-- core/src/labelled.rs | 5 ++--- core/src/lib.rs | 1 - src/lib.rs | 1 - src/monoid.rs | 2 +- src/semigroup.rs | 20 +++++++++++--------- src/validated.rs | 4 ++-- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/core/src/coproduct.rs b/core/src/coproduct.rs index ba6d7799..6bce74c4 100644 --- a/core/src/coproduct.rs +++ b/core/src/coproduct.rs @@ -1247,8 +1247,8 @@ mod tests { use super::Coproduct::*; use super::*; - use std::string::{String, ToString}; use std::format; + use std::string::{String, ToString}; #[test] fn test_coproduct_inject() { diff --git a/core/src/hlist.rs b/core/src/hlist.rs index aecb6adb..cb9d08f6 100644 --- a/core/src/hlist.rs +++ b/core/src/hlist.rs @@ -57,10 +57,10 @@ use crate::indices::{Here, Suffixed, There}; use crate::traits::{Func, IntoReverse, Poly, ToMut, ToRef}; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; #[cfg(feature = "alloc")] use alloc::vec::Vec; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use core::ops::Add; diff --git a/core/src/labelled.rs b/core/src/labelled.rs index 886bcec5..2e5162d9 100644 --- a/core/src/labelled.rs +++ b/core/src/labelled.rs @@ -737,9 +737,9 @@ impl Transmogrifier for Field { @@ -917,8 +917,7 @@ mod tests { use super::chars::*; use super::*; use alloc::collections::{LinkedList, VecDeque}; - use alloc::{boxed::Box, vec::Vec, format, vec}; - + use alloc::{boxed::Box, format, vec, vec::Vec}; // Set up some aliases #[allow(non_camel_case_types)] diff --git a/core/src/lib.rs b/core/src/lib.rs index 5475065a..51c6148e 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,5 +1,4 @@ #![no_std] - #![doc(html_playground_url = "https://play.rust-lang.org/")] //! Frunk Core //! diff --git a/src/lib.rs b/src/lib.rs index ca87c892..2633c15a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ #![no_std] - #![doc(html_playground_url = "https://play.rust-lang.org/")] //! Frunk: generic functional programming toolbelt for Rust //! diff --git a/src/monoid.rs b/src/monoid.rs index 6d91a90a..9c2130e6 100644 --- a/src/monoid.rs +++ b/src/monoid.rs @@ -299,7 +299,7 @@ mod tests { use super::*; #[cfg(feature = "alloc")] - use alloc::{vec, borrow::ToOwned}; + use alloc::{borrow::ToOwned, vec}; #[test] fn test_combine_n() { diff --git a/src/semigroup.rs b/src/semigroup.rs index 6c399833..3ed1ec5e 100644 --- a/src/semigroup.rs +++ b/src/semigroup.rs @@ -1,7 +1,9 @@ //! Module for holding the Semigroup typeclass definition and typeclass instances //! //! You can, for example, combine tuples. -#![cfg_attr(feature = "alloc", doc = r#" +#![cfg_attr( + feature = "alloc", + doc = r#" # Examples ``` @@ -27,18 +29,18 @@ assert_eq!(h1.combine(&h2), h3) ```"# )] -use frunk_core::hlist::*; +#[cfg(feature = "alloc")] +use alloc::{boxed::Box, string::String, vec::Vec}; use core::cell::*; use core::cmp::Ordering; +#[cfg(feature = "alloc")] +use core::hash::Hash; +use core::ops::{BitAnd, BitOr, Deref}; +use frunk_core::hlist::*; #[cfg(feature = "std")] use std::collections::hash_map::Entry; #[cfg(feature = "std")] use std::collections::{HashMap, HashSet}; -#[cfg(feature = "alloc")] -use core::hash::Hash; -#[cfg(feature = "alloc")] -use alloc::{string::String, vec::Vec, boxed::Box}; -use core::ops::{BitAnd, BitOr, Deref}; /// Wrapper type for types that are ordered and can have a Max combination #[derive(PartialEq, Debug, Eq, Clone, Copy, PartialOrd, Ord, Hash)] @@ -362,9 +364,9 @@ tuple_impls! { mod tests { use super::*; #[cfg(feature = "alloc")] - use frunk_core::hlist; - #[cfg(feature = "alloc")] use alloc::{borrow::ToOwned, vec}; + #[cfg(feature = "alloc")] + use frunk_core::hlist; macro_rules! semigroup_tests { ($($name:ident, $comb: expr => $expected: expr, $tr:ty)+) => { diff --git a/src/validated.rs b/src/validated.rs index 646abfb5..ea33156f 100644 --- a/src/validated.rs +++ b/src/validated.rs @@ -46,8 +46,8 @@ use super::hlist::*; -use core::ops::Add; use alloc::{vec, vec::Vec}; +use core::ops::Add; /// A Validated is either an Ok holding an HList or an Err, holding a vector /// of collected errors. @@ -245,8 +245,8 @@ where #[cfg(test)] mod tests { use super::*; - use frunk_core::{hlist, hlist_pat}; use alloc::{borrow::ToOwned, string::String}; + use frunk_core::{hlist, hlist_pat}; #[test] fn test_adding_ok_results() {