shatter

A fast, zero-copy nostr content parser in Rust
git clone git://jb55.com/shatter
Log | Files | Refs | README

commit 7d9c79d276a7830e4f658b5b9356259ec0addfe0
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  3 Jul 2023 07:47:34 -0700

smash!

Diffstat:
A.envrc | 1+
A.gitignore | 10++++++++++
A.rustfmt.toml | 1+
ACargo.toml | 8++++++++
AREADME.md | 5+++++
Ashell.nix | 5+++++
Asrc/lib.rs | 14++++++++++++++
7 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/.envrc b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.gitignore b/.gitignore @@ -0,0 +1,10 @@ +/target +.direnv + + +# Added by cargo +# +# already existing elements were commented out + +#/target +/Cargo.lock diff --git a/.rustfmt.toml b/.rustfmt.toml @@ -0,0 +1 @@ +edition = "2018" diff --git a/Cargo.toml b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "shatter" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/README.md b/README.md @@ -0,0 +1,5 @@ + +# shatter + +A fast, zero-copy nostr content parser. + diff --git a/shell.nix b/shell.nix @@ -0,0 +1,5 @@ +{ pkgs ? import <nixpkgs> {} }: +with pkgs; +mkShell { + nativeBuildInputs = [ cargo rustc rustfmt libiconv pkgconfig ]; +} diff --git a/src/lib.rs b/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}