Skip to content

Commit

Permalink
[Build] Update to 2018 edition (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydmeta committed Jun 25, 2021
1 parent 1bb2b7d commit 2b16d2c
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 48 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "frunk"
edition = "2018"
version = "0.4.0"
authors = ["Lloyd <lloydmeta@gmail.com>"]
description = "Frunk provides developers with a number of functional programming tools like HList, Coproduct, Generic, LabelledGeneric, Validated, Monoid, Semigroup and friends."
Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "frunk_core"
edition = "2018"
version = "0.4.0"
authors = ["Lloyd <lloydmeta@gmail.com>"]
description = "Frunk core provides developers with HList, Coproduct, LabelledGeneric and Generic"
Expand Down
8 changes: 4 additions & 4 deletions core/src/coproduct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
//! # }
//! ```

use hlist::{HCons, HNil};
use indices::{Here, There};
use traits::{Func, Poly, ToMut, ToRef};
use crate::hlist::{HCons, HNil};
use crate::indices::{Here, There};
use crate::traits::{Func, Poly, ToMut, ToRef};

/// Enum type representing a Coproduct. Think of this as a Result, but capable
/// of supporting any arbitrary number of types instead of just 2.
Expand Down Expand Up @@ -1122,7 +1122,7 @@ mod tests {
// ...including CNil.
#[allow(unused)]
let cnil: CNil = panic!();
let res: Result<CNil, _> = cnil.subset();
let _res: Result<CNil, _> = cnil.subset();
let _ = res;
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/hlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
//! # }
//! ```

use indices::{Here, Suffixed, There};
use traits::{Func, IntoReverse, Poly, ToMut, ToRef};
use crate::indices::{Here, Suffixed, There};
use crate::traits::{Func, IntoReverse, Poly, ToMut, ToRef};

use std::ops::Add;

Expand Down
10 changes: 5 additions & 5 deletions core/src/labelled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@
//! # }
//! ```

use hlist::*;
use indices::*;
use std::fmt;
use std::marker::PhantomData;
use crate::hlist::*;
use crate::indices::*;
use ::std::fmt;
use ::std::marker::PhantomData;

/// A trait that converts from a type to a labelled generic representation.
///
Expand Down Expand Up @@ -915,7 +915,7 @@ where
mod tests {
use super::chars::*;
use super::*;
use std::collections::{LinkedList, VecDeque};
use ::std::collections::{LinkedList, VecDeque};

// Set up some aliases
#[allow(non_camel_case_types)]
Expand Down
8 changes: 4 additions & 4 deletions core/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ macro_rules! poly_fn {
mod tests {
#[test]
fn trailing_commas() {
use test_structs::unit_copy::{A, B};
use crate::test_structs::unit_copy::{A, B};

let hlist_pat![]: HList![] = hlist![];
let hlist_pat![A]: HList![A] = hlist![A];
Expand Down Expand Up @@ -327,8 +327,8 @@ mod tests {

#[test]
fn ellipsis_tail() {
use coproduct::Coproduct;
use test_structs::unit_copy::{A, B, C};
use crate::coproduct::Coproduct;
use crate::test_structs::unit_copy::{A, B, C};

// hlist: accepted locations, and consistency between macros
let hlist_pat![...hlist_pat![C]]: HList![...HList![C]] = { hlist![...hlist![C]] };
Expand All @@ -350,7 +350,7 @@ mod tests {

#[test]
fn ellipsis_ignore() {
use test_structs::unit_copy::{A, B, C, D, E};
use crate::test_structs::unit_copy::{A, B, C, D, E};

// '...' accepted locations
let hlist_pat![...] = hlist![A, B, C, D, E];
Expand Down
2 changes: 1 addition & 1 deletion core/src/tuples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! # }
//! ```

use generic::Generic;
use crate::generic::Generic;

macro_rules! tup_def {
( $($dtype: ident),* ; ; ) => {};
Expand Down
1 change: 1 addition & 0 deletions derives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "frunk_derives"
edition = "2018"
version = "0.4.0"
authors = ["Lloyd <lloydmeta@gmail.com>"]
description = "frunk_derives contains the custom derivations for certain traits in Frunk."
Expand Down
4 changes: 2 additions & 2 deletions derives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ extern crate syn;
use proc_macro::TokenStream;

mod derive_generic;
use derive_generic::impl_generic;
use crate::derive_generic::impl_generic;

mod derive_labelled_generic;
use derive_labelled_generic::impl_labelled_generic;
use crate::derive_labelled_generic::impl_labelled_generic;

use quote::ToTokens;

Expand Down
1 change: 1 addition & 0 deletions laws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "frunk_laws"
edition = "2018"
version = "0.4.0"
authors = ["Lloyd <lloydmeta@gmail.com>"]
description = "frunk_laws contains laws for algebras declared in Frunk."
Expand Down
2 changes: 1 addition & 1 deletion laws/src/monoid_laws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ pub fn right_identity<A: Monoid + Eq>(a: A) -> bool {
#[cfg(test)]
mod tests {
use super::*;
use crate::wrapper::*;
use frunk::semigroup::*;
use quickcheck::quickcheck;
#[cfg(feature = "std")]
use std::collections::{HashMap, HashSet};
use wrapper::*;

#[test]
#[cfg(feature = "std")]
Expand Down
2 changes: 1 addition & 1 deletion laws/src/semigroup_laws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ pub fn associativity<A: Semigroup + Eq>(a: A, b: A, c: A) -> bool {
#[cfg(test)]
mod tests {
use super::*;
use crate::wrapper::*;
use quickcheck::quickcheck;
#[cfg(feature = "std")]
use std::collections::{HashMap, HashSet};
use wrapper::*;

#[test]
#[cfg(feature = "std")]
Expand Down
1 change: 1 addition & 0 deletions proc-macro-helpers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "frunk_proc_macro_helpers"
edition = "2018"
version = "0.1.0"
authors = ["Lloyd <lloydmeta@gmail.com>"]
description = "Common internal functions for frunk's proc macros"
Expand Down
1 change: 1 addition & 0 deletions proc-macros-impl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "frunk_proc_macros_impl"
edition = "2018"
version = "0.1.0"
authors = ["Lloyd <lloydmeta@gmail.com>"]
description = "Proc macros inernal implementations for Frunk"
Expand Down
1 change: 1 addition & 0 deletions proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "frunk_proc_macros"
edition = "2018"
version = "0.1.0"
authors = ["Lloyd <lloydmeta@gmail.com>"]
description = "Proc macros for Frunk"
Expand Down
50 changes: 25 additions & 25 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,54 +241,54 @@ pub use frunk_derives::*;
// Hyperlinks will be broken for the ones in `frunk::`, so we need to prevent it.

#[doc(no_inline)]
pub use hlist::lift_from;
pub use crate::hlist::lift_from;
#[doc(no_inline)]
pub use hlist::HCons;
pub use crate::hlist::HCons;
#[doc(no_inline)]
pub use hlist::HNil;
pub use crate::hlist::HNil;
#[doc(no_inline)]
pub use traits::Func;
pub use crate::traits::Func;
#[doc(no_inline)]
pub use traits::Poly;
pub use crate::traits::Poly;
#[doc(no_inline)]
pub use traits::{ToMut, ToRef}; // useful for where bounds
pub use crate::traits::{ToMut, ToRef}; // useful for where bounds

#[doc(no_inline)]
pub use coproduct::Coproduct;
pub use crate::coproduct::Coproduct;

#[doc(no_inline)]
pub use generic::convert_from;
pub use crate::generic::convert_from;
#[doc(no_inline)]
pub use generic::from_generic;
pub use crate::generic::from_generic;
#[doc(no_inline)]
pub use generic::into_generic;
pub use crate::generic::into_generic;
#[doc(no_inline)]
pub use generic::map_inter;
pub use crate::generic::map_inter;
#[doc(no_inline)]
pub use generic::map_repr;
pub use crate::generic::map_repr;
#[doc(no_inline)]
pub use generic::Generic;
pub use crate::generic::Generic;

#[doc(no_inline)]
pub use labelled::from_labelled_generic;
pub use crate::labelled::from_labelled_generic;
#[doc(no_inline)]
pub use labelled::into_labelled_generic;
pub use crate::labelled::into_labelled_generic;
#[doc(no_inline)]
pub use labelled::labelled_convert_from;
pub use crate::labelled::labelled_convert_from;
#[doc(no_inline)]
pub use labelled::transform_from;
pub use crate::labelled::transform_from;
#[doc(no_inline)]
pub use labelled::LabelledGeneric;
pub use crate::labelled::LabelledGeneric;

#[doc(no_inline)]
pub use semigroup::Semigroup;
pub use crate::semigroup::Semigroup;

#[doc(no_inline)]
pub use monoid::Monoid;
pub use crate::monoid::Monoid;

#[doc(no_inline)]
#[cfg(feature = "validated")]
pub use validated::Validated;
pub use crate::validated::Validated;

pub mod prelude {
//! Traits that need to be imported for the complete `frunk` experience.
Expand All @@ -297,13 +297,13 @@ pub mod prelude {
//! access to any missing methods advertised in frunk's documentation.

#[doc(no_inline)]
pub use hlist::HList; // for LEN
pub use crate::hlist::HList; // for LEN
#[doc(no_inline)]
pub use hlist::LiftFrom;
pub use crate::hlist::LiftFrom;
#[doc(no_inline)]
pub use hlist::LiftInto;
pub use crate::hlist::LiftInto;

#[doc(no_inline)]
#[cfg(feature = "validated")]
pub use validated::IntoValidated;
pub use crate::validated::IntoValidated;
}
2 changes: 1 addition & 1 deletion tests/generic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate frunk_core;
use frunk::{convert_from, from_generic, into_generic};

mod common;
use common::*;
use crate::common::*;

#[test]
fn test_struct_from_generic() {
Expand Down
2 changes: 1 addition & 1 deletion tests/labelled_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use frunk::{Coproduct, HCons, LabelledGeneric};

mod common;

use common::*;
use crate::common::*;

use self::time::*;

Expand Down
2 changes: 1 addition & 1 deletion tests/validated_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extern crate frunk_core;
use frunk::prelude::*;

mod common;
use common::*;
use crate::common::*;

// Working with Validated

Expand Down

0 comments on commit 2b16d2c

Please sign in to comment.