From f1bb6d51bc3df9910cbb1d0c2afc1c0dcf55f7dd Mon Sep 17 00:00:00 2001 From: Jakob <31919330+Jakobzs@users.noreply.github.com> Date: Tue, 3 Jan 2023 17:42:46 +0100 Subject: [PATCH] Initial commit --- .github/license-mit | 21 +++++++++++++++++++++ .github/readme.md | 29 +++++++++++++++++++++++++++++ .github/workflows/rust.yml | 28 ++++++++++++++++++++++++++++ .gitignore | 2 ++ Cargo.toml | 9 +++++++++ src/lib.rs | 14 ++++++++++++++ 6 files changed, 103 insertions(+) create mode 100644 .github/license-mit create mode 100644 .github/readme.md create mode 100644 .github/workflows/rust.yml create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 src/lib.rs diff --git a/.github/license-mit b/.github/license-mit new file mode 100644 index 0000000..6f1d712 --- /dev/null +++ b/.github/license-mit @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Jakobzs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.github/readme.md b/.github/readme.md new file mode 100644 index 0000000..fe71580 --- /dev/null +++ b/.github/readme.md @@ -0,0 +1,29 @@ +# patternscanner + +[![Build](https://github.com/jakobzs/patternscanner/workflows/build/badge.svg)](https://github.com/jakobzs/patternscanner) +[![API](https://docs.rs/patternscanner/badge.svg)](https://docs.rs/patternscanner) +[![Crate](https://img.shields.io/crates/v/patternscanner)](https://crates.io/crates/patternscanner) +[![dependency status](https://deps.rs/repo/github/jakobzs/patternscanner/status.svg)](https://deps.rs/repo/github/jakobzs/patternscanner) + +A pattern scanner for bytes. + +## Installation + +Add this crate as a dependency to your `Cargo.toml` file. + +```toml +[dependencies] +patternscanner = "0.0.0" +``` + +## Example + +TODO + +## License + +[MIT](license-mit) + +## Contributing + +Contributions are welcome. diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..2123342 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,28 @@ +name: Rust + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v1 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Clippy + run: cargo clippy + + - name: Build + run: cargo build --verbose + + - name: Tests + run: cargo test --verbose diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4fffb2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +/Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b56b771 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "patternscanner" +version = "0.0.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rayon = "1" \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ 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); + } +}