Initial commit
This commit is contained in:
commit
24837c68c1
4
.cargo/audit.toml
Normal file
4
.cargo/audit.toml
Normal file
@ -0,0 +1,4 @@
|
||||
# Doesn't work in the sandbox
|
||||
[yanked]
|
||||
enabled = false # Warn for yanked crates in Cargo.lock (default: true)
|
||||
update_index = false # Auto-update the crates.io index (default: true)
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/target
|
||||
result*
|
||||
107
Cargo.lock
generated
Normal file
107
Cargo.lock
generated
Normal file
@ -0,0 +1,107 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "adler2"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.8.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
|
||||
dependencies = [
|
||||
"adler2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quick-start"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"weakauras-codec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||
|
||||
[[package]]
|
||||
name = "weakauras-codec"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce92b0d8f12066b02b56c33f5849d05a51455136e60d4c689334b3303c2b5120"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"weakauras-codec-ace-serialize",
|
||||
"weakauras-codec-base64",
|
||||
"weakauras-codec-lib-serialize",
|
||||
"weakauras-codec-lua-value",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "weakauras-codec-ace-serialize"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67697248521a7e820a9a113f5ebc8d47f2f95200e1d55e322e6a8da6a18041e1"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
"weakauras-codec-lua-value",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "weakauras-codec-base64"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9210ac787965f81539d5b2b72784662269b0a1ef13052a61b4e2436080c934df"
|
||||
|
||||
[[package]]
|
||||
name = "weakauras-codec-lib-serialize"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfa15712bcfde5730b707225600e48ab8bf6e25382c5447314c5340d03a742bb"
|
||||
dependencies = [
|
||||
"weakauras-codec-lua-value",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "weakauras-codec-lua-value"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff4de98489c6a5c9be2710562d464b76ef21e3b2ac0e5ddae7ff639075293958"
|
||||
10
Cargo.toml
Normal file
10
Cargo.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "quick-start"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
weakauras-codec = "0.1.0"
|
||||
94
flake.lock
Normal file
94
flake.lock
Normal file
@ -0,0 +1,94 @@
|
||||
{
|
||||
"nodes": {
|
||||
"advisory-db": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1752868093,
|
||||
"narHash": "sha256-jcuTu/CBxy75F53EB1+9Ug4SH0HXPXy1BlMQfWDoMIQ=",
|
||||
"owner": "rustsec",
|
||||
"repo": "advisory-db",
|
||||
"rev": "babf308081c6c1ad21495aa3128957b14146e7cb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "rustsec",
|
||||
"repo": "advisory-db",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"crane": {
|
||||
"locked": {
|
||||
"lastModified": 1752946753,
|
||||
"narHash": "sha256-g5uP3jIj+STUcfTJDKYopxnSijs2agRg13H0SGL5iE4=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "544d09fecc8c2338542c57f3f742f1a0c8c71e13",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1753151930,
|
||||
"narHash": "sha256-XSQy6wRKHhRe//iVY5lS/ZpI/Jn6crWI8fQzl647wCg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "83e677f31c84212343f4cc553bab85c2efcad60a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"advisory-db": "advisory-db",
|
||||
"crane": "crane",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
150
flake.nix
Normal file
150
flake.nix
Normal file
@ -0,0 +1,150 @@
|
||||
{
|
||||
description = "Build a cargo project";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
crane.url = "github:ipetkov/crane";
|
||||
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
advisory-db = {
|
||||
url = "github:rustsec/advisory-db";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
crane,
|
||||
flake-utils,
|
||||
advisory-db,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
||||
craneLib = crane.mkLib pkgs;
|
||||
src = craneLib.cleanCargoSource ./.;
|
||||
|
||||
# Common arguments can be set here to avoid repeating them later
|
||||
commonArgs = {
|
||||
inherit src;
|
||||
strictDeps = true;
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
# Add additional build inputs here
|
||||
]
|
||||
++ lib.optionals pkgs.stdenv.isDarwin [
|
||||
# Additional darwin specific inputs can be set here
|
||||
pkgs.libiconv
|
||||
];
|
||||
|
||||
# Additional environment variables can be set directly
|
||||
# MY_CUSTOM_VAR = "some value";
|
||||
};
|
||||
|
||||
# Build *just* the cargo dependencies, so we can reuse
|
||||
# all of that work (e.g. via cachix) when running in CI
|
||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
||||
|
||||
# Build the actual crate itself, reusing the dependency
|
||||
# artifacts from above.
|
||||
my-crate = craneLib.buildPackage (
|
||||
commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
checks = {
|
||||
# Build the crate as part of `nix flake check` for convenience
|
||||
inherit my-crate;
|
||||
|
||||
# Run clippy (and deny all warnings) on the crate source,
|
||||
# again, reusing the dependency artifacts from above.
|
||||
#
|
||||
# Note that this is done as a separate derivation so that
|
||||
# we can block the CI if there are issues here, but not
|
||||
# prevent downstream consumers from building our crate by itself.
|
||||
my-crate-clippy = craneLib.cargoClippy (
|
||||
commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||
}
|
||||
);
|
||||
|
||||
my-crate-doc = craneLib.cargoDoc (
|
||||
commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
}
|
||||
);
|
||||
|
||||
# Check formatting
|
||||
my-crate-fmt = craneLib.cargoFmt {
|
||||
inherit src;
|
||||
};
|
||||
|
||||
my-crate-toml-fmt = craneLib.taploFmt {
|
||||
src = pkgs.lib.sources.sourceFilesBySuffices src [ ".toml" ];
|
||||
# taplo arguments can be further customized below as needed
|
||||
# taploExtraArgs = "--config ./taplo.toml";
|
||||
};
|
||||
|
||||
# Audit dependencies
|
||||
my-crate-audit = craneLib.cargoAudit {
|
||||
inherit src advisory-db;
|
||||
};
|
||||
|
||||
# Audit licenses
|
||||
my-crate-deny = craneLib.cargoDeny {
|
||||
inherit src;
|
||||
};
|
||||
|
||||
# Run tests with cargo-nextest
|
||||
# Consider setting `doCheck = false` on `my-crate` if you do not want
|
||||
# the tests to run twice
|
||||
my-crate-nextest = craneLib.cargoNextest (
|
||||
commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
partitions = 1;
|
||||
partitionType = "count";
|
||||
cargoNextestPartitionsExtraArgs = "--no-tests=pass";
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
packages = {
|
||||
default = my-crate;
|
||||
};
|
||||
|
||||
apps.default = flake-utils.lib.mkApp {
|
||||
drv = my-crate;
|
||||
};
|
||||
|
||||
devShells.default = craneLib.devShell {
|
||||
# Inherit inputs from checks.
|
||||
checks = self.checks.${system};
|
||||
|
||||
# Additional dev-shell environment variables can be set directly
|
||||
# MY_CUSTOM_DEVELOPMENT_VAR = "something else";
|
||||
|
||||
# Extra inputs can be added here; cargo and rustc are provided by default.
|
||||
packages = [
|
||||
pkgs.rust-analyzer
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
16
src/main.rs
Normal file
16
src/main.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use weakauras_codec::decode;
|
||||
|
||||
fn main() {
|
||||
let result = decode(TEST_WA, None);
|
||||
|
||||
match result {
|
||||
Ok(output) => {
|
||||
println!("Result: {output:#?}");
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Error: {e:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const TEST_WA: &[u8] = b"!TN1wVjUru4)liTQKQwIVGb8kTvkKMSB2MqIwtAvFXXdMXGBmEqJhtcV4F79CgBW3WK7DB3UWd2mEMZLVZ58nNXyRAp22AHT1uBRiBlTo96OyBDhzg7SF12I)z9po8pjl6JphMh9(LKWP0P2dTTwr5r(Sq7rQ2w(WQTeKzZO8eNHeUT19x65frf2J(zLokkkDhmqBGQMHTLG7JtdLw0C2DxgU56rUc)vuBbOk)O)kom9NwKGaq(HckpKe87B0PoSk6cWeSTu7OGMmro)XPs)c2ukOAvfCAbExXabyBn8YXJV8IZp5uq3bmI0JM67557ghiwlXb4gF4gbAgEOibLvDC3asuK0(9dNfaM4fxo63Wha)KZIxwBbCIlT2GXr0BsLeajXGu4SG6ZA5QLcsafS(QpzVdRvDCuHCaiNlelJE)HhIb4o(Sd3gGpeIIC6mWFhVEjynPEI16THrnfToMMM91m07QoW2kmErgyhHPaGcwbx7QbYHivQLlCzKm96o)PI52J0Wh2qAdSQPt9r8MeCJyJG3iG4W80grPCOP0jXEEP28No6lxC61NNITHKfumnfVMjiRZ9NnxK4SrLzrHOL0GGZK50S7cVmmynEBCOpI)bK1OXTZuvRO4jUmW2W5V5(JLdGjOcPrrI5e4PP6ik1(rB6g2skNiyGW)Wh2obiDwRRwFOoHUcdVwFIscaSZY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42wf9PA6qvoZ9RH0zNlJIeAP0yTHlvzFQSF7l4C4pksgCsz1Tt(ArTahlgKcujN1LxJmFpjoM6VLKcTUv8iw7SL)6TNvUJ4k9(vUtVh(m1L7tSyRFL6suuGNRcb1o66DtBfV6SDdz)XUi82vJ3FJr5177uEFlt5n8FAkVTcuVYuEouEfp9EnoL3aATI0ufiq3pBxv(S6DjvNOUzoVYC8BERg5eE9KndQRyO23O)a1NoH3rlKVxNV(SD5TXA2v(ILnmgyyQJV6Z3gIWNe92Rc52JLA75rS9yP1(2GuB)um4pg(6F6XM)3xAIoR5)(L)t2CwDQR60BpbYmJhhzMUXEiWUIYDP)lGb7DfOWmn((7w67mdf(FDzlMqKfuViEI)V20d(1(V)";
|
||||
13
taplo.toml
Normal file
13
taplo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
# Sorts `Cargo.toml` dependencies. All other `.toml` files are formatted with the default config.
|
||||
#
|
||||
# https://taplo.tamasfe.dev/configuration/file.html#configuration-file
|
||||
|
||||
[formatting]
|
||||
reorder_keys = false
|
||||
|
||||
[[rule]]
|
||||
include = ["**/Cargo.toml"]
|
||||
keys = ["dependencies"]
|
||||
|
||||
[rule.formatting]
|
||||
reorder_keys = true
|
||||
Loading…
Reference in New Issue
Block a user