Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddOnTop committed Oct 12, 2024
0 parents commit ee31814
Show file tree
Hide file tree
Showing 8 changed files with 1,029 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
281 changes: 281 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "tailcall-valid"
version = "0.1.0"
edition = "2021"

[dependencies]
derive_setters = "0.1.6"
regex = "1.11.0"
thiserror = "1.0.64"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
serde_path_to_error = "0.1.16"
http = "1.1.0"

[dev-dependencies]
pretty_assertions = "1.4.1"
stripmargin = "0.1.1"
78 changes: 78 additions & 0 deletions src/append.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
pub trait Append<A> {
type Out;
fn append(self, a: A) -> Self::Out;
}

impl<A0, A1> Append<A1> for (A0,) {
type Out = (A0, A1);
fn append(self, a1: A1) -> Self::Out {
let (a0,) = self;
(a0, a1)
}
}
impl<A0, A1, A2> Append<A2> for (A0, A1) {
type Out = (A0, A1, A2);
fn append(self, a2: A2) -> Self::Out {
let (a0, a1) = self;
(a0, a1, a2)
}
}
impl<A0, A1, A2, A3> Append<A3> for (A0, A1, A2) {
type Out = (A0, A1, A2, A3);
fn append(self, a3: A3) -> Self::Out {
let (a0, a1, a2) = self;
(a0, a1, a2, a3)
}
}
impl<A0, A1, A2, A3, A4> Append<A4> for (A0, A1, A2, A3) {
type Out = (A0, A1, A2, A3, A4);
fn append(self, a4: A4) -> Self::Out {
let (a0, a1, a2, a3) = self;
(a0, a1, a2, a3, a4)
}
}
impl<A0, A1, A2, A3, A4, A5> Append<A5> for (A0, A1, A2, A3, A4) {
type Out = (A0, A1, A2, A3, A4, A5);
fn append(self, a5: A5) -> Self::Out {
let (a0, a1, a2, a3, a4) = self;
(a0, a1, a2, a3, a4, a5)
}
}

impl<A0, A1, A2, A3, A4, A5, A6> Append<A6> for (A0, A1, A2, A3, A4, A5) {
type Out = (A0, A1, A2, A3, A4, A5, A6);
fn append(self, a6: A6) -> Self::Out {
let (a0, a1, a2, a3, a4, a5) = self;
(a0, a1, a2, a3, a4, a5, a6)
}
}
impl<A0, A1, A2, A3, A4, A5, A6, A7> Append<A7> for (A0, A1, A2, A3, A4, A5, A6) {
type Out = (A0, A1, A2, A3, A4, A5, A6, A7);
fn append(self, a7: A7) -> Self::Out {
let (a0, a1, a2, a3, a4, a5, a6) = self;
(a0, a1, a2, a3, a4, a5, a6, a7)
}
}
impl<A0, A1, A2, A3, A4, A5, A6, A7, A8> Append<A8> for (A0, A1, A2, A3, A4, A5, A6, A7) {
type Out = (A0, A1, A2, A3, A4, A5, A6, A7, A8);
fn append(self, a8: A8) -> Self::Out {
let (a0, a1, a2, a3, a4, a5, a6, a7) = self;
(a0, a1, a2, a3, a4, a5, a6, a7, a8)
}
}
impl<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9> Append<A9> for (A0, A1, A2, A3, A4, A5, A6, A7, A8) {
type Out = (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9);
fn append(self, a9: A9) -> Self::Out {
let (a0, a1, a2, a3, a4, a5, a6, a7, a8) = self;
(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
}
}
impl<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Append<A10>
for (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)
{
type Out = (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
fn append(self, a10: A10) -> Self::Out {
let (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) = self;
(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
}
}
Loading

0 comments on commit ee31814

Please sign in to comment.