[no description]
-rw-r--r--build.rs21
-rw-r--r--rustfmt.toml7
-rw-r--r--src/lib.rs10
3 files changed, 30 insertions, 8 deletions
diff --git a/build.rs b/build.rs
index 1fabe52..b43249d 100644
--- a/build.rs
+++ b/build.rs
@@ -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"
diff --git a/src/lib.rs b/src/lib.rs
index 2b2f999..d915d21 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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