Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat(harper-lib): create new crate harper-lib

Grant Lemonsd5b485f0fdb6
diff --git a/Cargo.toml b/Cargo.toml
index 839007f17..30d3775d5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
[workspace]
-members = [ "harper-cli", "harper-core", "harper-dictionary-parsing", "harper-ls", "harper-comments", "harper-wasm", "harper-tree-sitter", "harper-html"]
+members = [ "harper-cli", "harper-core", "harper-dictionary-parsing", "harper-ls", "harper-comments", "harper-wasm", "harper-tree-sitter", "harper-html", "harper-lib"]
resolver = "2"
[profile.release]
diff --git a/harper-lib/Cargo.toml b/harper-lib/Cargo.toml
new file mode 100644
index 000000000..18de14d36
--- /dev/null
+++ b/harper-lib/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "harper-lib"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
diff --git a/harper-lib/src/lib.rs b/harper-lib/src/lib.rs
new file mode 100644
index 000000000..b93cf3ffd
--- /dev/null
+++ b/harper-lib/src/lib.rs
@@ -0,0 +1,14 @@
+pub fn add(left: u64, right: u64) -> u64 {
+ left + right
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn it_works() {
+ let result = add(2, 2);
+ assert_eq!(result, 4);
+ }
+}