From 8fe6cf0a1e087c3e7ff449789c23b450f453f51b Mon Sep 17 00:00:00 2001 From: madclaws Date: Sun, 29 Oct 2023 21:35:31 +0530 Subject: [PATCH] fix: removed rust dependency --- lib/ex_ucan/native.ex | 10 -- mix.exs | 3 - native/exucan_native/.cargo/config.toml | 5 - native/exucan_native/.gitignore | 1 - native/exucan_native/Cargo.lock | 149 ------------------------ native/exucan_native/Cargo.toml | 13 --- native/exucan_native/README.md | 20 ---- native/exucan_native/src/lib.rs | 6 - 8 files changed, 207 deletions(-) delete mode 100644 lib/ex_ucan/native.ex delete mode 100644 native/exucan_native/.cargo/config.toml delete mode 100644 native/exucan_native/.gitignore delete mode 100644 native/exucan_native/Cargo.lock delete mode 100644 native/exucan_native/Cargo.toml delete mode 100644 native/exucan_native/README.md delete mode 100644 native/exucan_native/src/lib.rs diff --git a/lib/ex_ucan/native.ex b/lib/ex_ucan/native.ex deleted file mode 100644 index d3e3f01..0000000 --- a/lib/ex_ucan/native.ex +++ /dev/null @@ -1,10 +0,0 @@ -defmodule ExUcan.Native do - # TODO Add doc - @moduledoc """ - - """ - - use Rustler, otp_app: :ex_ucan, crate: "exucan_native" - - def add(_a, _b), do: :erlang.nif_error(:nif_not_loaded) -end diff --git a/mix.exs b/mix.exs index 52b11a3..1411a7d 100644 --- a/mix.exs +++ b/mix.exs @@ -21,11 +21,8 @@ defmodule ExUcan.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:rustler, "~> 0.30.0", runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:b58, "~> 1.0.2"} - # {:dep_from_hexpm, "~> 0.3.0"}, - # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} ] end end diff --git a/native/exucan_native/.cargo/config.toml b/native/exucan_native/.cargo/config.toml deleted file mode 100644 index 20f03f3..0000000 --- a/native/exucan_native/.cargo/config.toml +++ /dev/null @@ -1,5 +0,0 @@ -[target.'cfg(target_os = "macos")'] -rustflags = [ - "-C", "link-arg=-undefined", - "-C", "link-arg=dynamic_lookup", -] diff --git a/native/exucan_native/.gitignore b/native/exucan_native/.gitignore deleted file mode 100644 index ea8c4bf..0000000 --- a/native/exucan_native/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/native/exucan_native/Cargo.lock b/native/exucan_native/Cargo.lock deleted file mode 100644 index 23b95c7..0000000 --- a/native/exucan_native/Cargo.lock +++ /dev/null @@ -1,149 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "exucan_native" -version = "0.1.0" -dependencies = [ - "rustler", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "rustler" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4b4fea69e23de68c42c06769d6624d2d018da550c17244dd4b691f90ced4a7e" -dependencies = [ - "lazy_static", - "rustler_codegen", - "rustler_sys", -] - -[[package]] -name = "rustler_codegen" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406061bd07aaf052c344257afed4988c5ec8efe4d2352b4c2cf27ea7c8575b12" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "rustler_sys" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7c0740e5322b64e2b952d8f0edce5f90fcf6f6fe74cca3f6e78eb3de5ea858" -dependencies = [ - "regex", - "unreachable", -] - -[[package]] -name = "syn" -version = "2.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -dependencies = [ - "void", -] - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" diff --git a/native/exucan_native/Cargo.toml b/native/exucan_native/Cargo.toml deleted file mode 100644 index 50f4e08..0000000 --- a/native/exucan_native/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "exucan_native" -version = "0.1.0" -authors = [] -edition = "2021" - -[lib] -name = "exucan_native" -path = "src/lib.rs" -crate-type = ["cdylib"] - -[dependencies] -rustler = "0.30.0" diff --git a/native/exucan_native/README.md b/native/exucan_native/README.md deleted file mode 100644 index c0d140a..0000000 --- a/native/exucan_native/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# NIF for Elixir.ExUcan.Native - -## To build the NIF module: - -- Your NIF will now build along with your project. - -## To load the NIF: - -```elixir -defmodule ExUcan.Native do - use Rustler, otp_app: :ex_ucan, crate: "exucan_native" - - # When your NIF is loaded, it will override this function. - def add(_a, _b), do: :erlang.nif_error(:nif_not_loaded) -end -``` - -## Examples - -[This](https://github.com/rusterlium/NifIo) is a complete example of a NIF written in Rust. diff --git a/native/exucan_native/src/lib.rs b/native/exucan_native/src/lib.rs deleted file mode 100644 index 2f1c59c..0000000 --- a/native/exucan_native/src/lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -#[rustler::nif] -fn add(a: i64, b: i64) -> i64 { - a + b -} - -rustler::init!("Elixir.ExUcan.Native", [add]);