[no description]
| -rw-r--r-- | build.rs | 21 | ||||
| -rw-r--r-- | rustfmt.toml | 7 | ||||
| -rw-r--r-- | src/lib.rs | 10 |
3 files changed, 30 insertions, 8 deletions
@@ -1,10 +1,15 @@ -use std::{fs::File, io::Write, path::Path}; +use std::fs::File; +use std::io::Write; +use std::path::Path; fn main() { let e = std::env::var("OUT_DIR").unwrap(); - let mut impl_td = File::create(Path::new(&e).join("impl_td.rs")).unwrap(); - let mut impl_rv = File::create(Path::new(&e).join("impl_rv.rs")).unwrap(); - let mut impl_pk = File::create(Path::new(&e).join("impl_pk.rs")).unwrap(); + let mut impl_td = + File::create(Path::new(&e).join("impl_td.rs")).unwrap(); + let mut impl_rv = + File::create(Path::new(&e).join("impl_rv.rs")).unwrap(); + let mut impl_pk = + File::create(Path::new(&e).join("impl_pk.rs")).unwrap(); for n in 0..26 { let z = ('A'..='Z').take(n).collect::<Vec<_>>().into_iter(); generate(z, &mut impl_td, &mut impl_rv, &mut impl_pk); @@ -20,7 +25,10 @@ fn tup(x: impl Iterator<Item = char>) -> String { s } fn generate( - x: impl Iterator<Item = char> + Clone + DoubleEndedIterator + ExactSizeIterator, + x: impl Iterator<Item = char> + + Clone + + DoubleEndedIterator + + ExactSizeIterator, impl_td: &mut impl Write, impl_rv: &mut impl Write, impl_pk: &mut impl Write, @@ -62,7 +70,8 @@ fn generate( type At = {at}; type L = ({left}); type R = ({right}); - fn repick(({left}): Self::L, at: Self::At, ({right}): Self::R) -> Self {{ + fn repick(({left}): Self::L, at: Self::At, ({right}): Self::R) -> \ + Self {{ ({left} at, {right}) }} fn depict(self) -> (Self::L, Self::At, Self::R) {{ diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..c39da03 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,7 @@ +max_width = 75 +format_strings = true +group_imports = "StdExternalCrate" +imports_granularity = "Module" +match_arm_blocks = false +style_edition = "2024" +use_small_heuristics = "Max" @@ -14,7 +14,9 @@ pub trait Reverse: Tupl { #[doc(inline)] pub use Reverse::{reverse, reverse as flip}; #[doc(inline)] -pub use Tupl::{drop, head, head as left, head as fst, last, last as right, pick, take}; +pub use Tupl::{ + drop, head, head as left, head as fst, last, last as right, pick, take, +}; pub use picks::*; /// Construct a tuple. pub fn cons<T, Tup: Cons<T>>(x: T, y: Tup) -> Tup::Cons { @@ -153,7 +155,11 @@ pub trait Tupl: core::marker::Tuple { /// untcurtsnocs self, returning init and last (see listmonster) fn unsnoc(self) -> (Self::Init, Self::Last); /// weird thing, full construct - fn fcons(start: Self::Head, inner: Self::Inner, last: Self::Last) -> Self; + fn fcons( + start: Self::Head, + inner: Self::Inner, + last: Self::Last, + ) -> Self; /// reconstruct; dont use directly fn cons(head: Self::Head, tail: Self::Tail) -> Self; /// retcurtsnoc; dont use directly |