-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Filippo Costa <filippo@neysofu.me>
- Loading branch information
Showing
50 changed files
with
1,430 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: -D warnings | ||
# This is faster for CI: https://github.com/dtolnay/rust-toolchain/issues/26. | ||
CARGO_INCREMENTAL: "0" | ||
|
||
jobs: | ||
check: | ||
name: check | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: rui314/setup-mold@v1 | ||
- name: Install Rust | ||
run: rustup show && rustup install nightly && rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu # Nightly is needed for our configuration of cargo fmt | ||
- run: cargo check --all-targets --all-features | ||
- run: cargo test --all-targets --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
target/ | ||
a.out | ||
|
||
# Rust and Cargo | ||
**/*.rs.bk | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["crates/*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,10 @@ fun foobar() { | |
bar = 3 | ||
return bar | ||
} | ||
|
||
type U32 = struct { | ||
a: U8, | ||
b: U8, | ||
c: U8, | ||
d: U8, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
trait Rgb: $Unit[$Color] = { | ||
let r: $Ratio | ||
let g: $Ratio | ||
let b: $Ratio | ||
|
||
let as | $CMYK = ( | ||
$Cmyk ([R1,G1,B1] map (X -> (1-X-K)/(1-K)),K) | ||
) where { | ||
let (R1, G1, B1) = ($R, $G, $B) map (_/255) | ||
let K = 1 - (($R1, $G1, $B1) max) } | ||
|
||
as $HSL = { | ||
let R1,G1,B1 = [R,G,B] map (_/255) | ||
set MAX = [R,G,B] max | ||
set MIN = [R,G,B] min | ||
set H,S,L = (MAX+MIN) / 2 | ||
if MAX == MIN then { | ||
H,S = 0 } | ||
else { | ||
let DIFF = MAX-MIN }} | ||
|
||
let gray = ($R*0.299 + $G*0.587 + $B*0.114) as $Ratio } |
Oops, something went wrong.