commit 62f0fa71cb47a76859804a59400a013a48d95ed4 Author: David Skrundz Date: Fri Dec 22 23:21:13 2023 -0700 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a8dfb24 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# OS Files +*~ +._* +.DS_Store + +# Rust +/target +# Rust Libraries Only +/Cargo.lock diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..5e7f9e2 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,2 @@ +hard_tabs = true +wrap_comments = true diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..bf12d09 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + "recommendations": [ + "vadimcn.vscode-lldb", + "barbosshack.crates-io", + "usernamehw.errorlens", + "tamasfe.even-better-toml", + "rust-lang.rust-analyzer", + "karunamurti.tera", // Tera templates + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..dd429e9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,32 @@ +{ + // VSCode + "editor.detectIndentation": false, + "editor.insertSpaces": false, + "editor.tabSize": 4, + "files.exclude": { + "**/target": true, + "**/Cargo.lock": true, + }, + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "files.trimTrailingWhitespace": true, + "files.watcherExclude": { + "**/.git/**": true, + "**/target/**": true, + }, + // Extensions + "crates.listPreReleases": true, + "evenBetterToml.formatter.alignComments": true, + "evenBetterToml.formatter.alignEntries": false, + "evenBetterToml.formatter.allowedBlankLines": 1, + "evenBetterToml.formatter.arrayAutoExpand": true, + "evenBetterToml.formatter.arrayTrailingComma": true, + "evenBetterToml.formatter.columnWidth": 80, + "evenBetterToml.formatter.reorderKeys": true, + "evenBetterToml.formatter.trailingNewline": true, + "rust-analyzer.imports.granularity.enforce": true, + "rust-analyzer.imports.granularity.group": "module", + "rust-analyzer.imports.group.enable": true, + "rust-analyzer.imports.merge.glob": false, + "rust-analyzer.imports.preferNoStd": true, +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2f4b83c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,6 @@ +How to Contribute +================= + +We'd love to accept your patches and contributions to this project. +We just need you to follow the Contributor License Agreement outlined +in the latest v0.0.x of https://github.com/Skrunix/license diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..67562e7 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,20 @@ +[workspace] +members = ["rust"] +resolver = "2" + +[workspace.package] +authors = [] +edition = "2021" +license-file = "LICENSE.md" +rust-version = "1.64.0" + +[workspace.lints.rust] +unsafe_code = "forbid" + +[profile.release] +lto = "fat" +opt-level = 3 +strip = "debuginfo" + +[workspace.dependencies] +# crate = { version = "^0", default-features = false } diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..161d3b0 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +Skrunix Software License +======================== + +Permission to use, copy, modify, and/or distribute this software is +outlined in the latest v0.0.x of https://github.com/Skrunix/license + +THE SOFTWARE IS PROVIDED "AS IS" diff --git a/README.md b/README.md new file mode 100644 index 0000000..76a6cd4 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Workspace Template + +Make sure not to keep git history when copying this template diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..292fe49 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" diff --git a/rust/Cargo.toml b/rust/Cargo.toml new file mode 100644 index 0000000..08397b7 --- /dev/null +++ b/rust/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "rust" +version = "0.0.0" + +authors.workspace = true +edition.workspace = true +license-file.workspace = true +rust-version.workspace = true + +[lints] +workspace = true + +[dependencies] +# crate = { workspace = true } diff --git a/rust/src/lib.rs b/rust/src/lib.rs new file mode 100644 index 0000000..06d268d --- /dev/null +++ b/rust/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); + } +}