Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
adriankumpf committed Jun 22, 2018
1 parent bb60c0a commit e8ae167
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 34 deletions.
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Arb.MixProject do
def project do
[
app: :arb,
version: "0.2.1",
version: "0.2.2",
elixir: "~> 1.6",
start_permanent: Mix.env() == :prod,
compilers: [:rustler] ++ Mix.compilers(),
Expand All @@ -28,7 +28,7 @@ defmodule Arb.MixProject do

defp deps do
[
{:rustler, "~> 0.16.0"},
{:rustler, "~> 0.17.0"},
{:ex_doc, "~> 0.16", only: :dev, runtime: false}
]
end
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{
"earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.18.3", "f4b0e4a2ec6f333dccf761838a4b253d75e11f714b85ae271c9ae361367897b7", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
"rustler": {:hex, :rustler, "0.16.0", "9b04237d2e7b30fcae40a28edb56f59aad8f4e3c8790f4996b5f200f649964be", [:mix], [], "hexpm"},
"rustler": {:hex, :rustler, "0.17.1", "2b4f120daf411b4eebd8cad6cb68f7d519dc409ca9e70daa8856d1d37b13e203", [:mix], [], "hexpm"},
}
40 changes: 17 additions & 23 deletions native/arb/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions native/arb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path = "src/lib.rs"
crate-type = ["dylib"]

[dependencies]
rustler = "0.16.0"
rustler_codegen = "0.16.0"
rustler = "0.17.0"
rustler_codegen = "0.17.0"
lazy_static = "1.0.0"
arb = { git = "https://github.com/adriankumpf/abacom-relay-board", tag = 'v0.2.1' }
13 changes: 7 additions & 6 deletions native/arb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ extern crate rustler_codegen;

extern crate arb;

use rustler::{NifEncoder, NifEnv, NifResult, NifTerm, types::NifListIterator};
use rustler::types::ListIterator;
use rustler::{Encoder, Env, NifResult, Term};

mod atoms {
rustler_atoms! {
Expand All @@ -30,7 +31,7 @@ struct Options {
pub verify: bool,
}

fn arb_error_to_term<'a>(env: NifEnv<'a>, err: arb::Error) -> NifTerm<'a> {
fn arb_error_to_term<'a>(env: Env<'a>, err: arb::Error) -> Term<'a> {
use arb::Error;

let error = match err {
Expand All @@ -47,8 +48,8 @@ fn arb_error_to_term<'a>(env: NifEnv<'a>, err: arb::Error) -> NifTerm<'a> {
(atoms::error(), error).encode(env)
}

fn activate<'a>(env: NifEnv<'a>, args: &[NifTerm<'a>]) -> NifResult<NifTerm<'a>> {
let list_iterator: NifListIterator = args[0].decode()?;
fn activate<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> {
let list_iterator: ListIterator = args[0].decode()?;
let result: NifResult<Vec<u8>> = list_iterator
.map(|x| x.decode::<u8>())
.collect::<NifResult<Vec<u8>>>();
Expand All @@ -67,7 +68,7 @@ fn activate<'a>(env: NifEnv<'a>, args: &[NifTerm<'a>]) -> NifResult<NifTerm<'a>>
}
}

fn get_active<'a>(env: NifEnv<'a>, args: &[NifTerm<'a>]) -> NifResult<NifTerm<'a>> {
fn get_active<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> {
let port: Option<u8> = args[0].decode()?;

let result = match arb::get_status(port) {
Expand All @@ -88,7 +89,7 @@ fn get_active<'a>(env: NifEnv<'a>, args: &[NifTerm<'a>]) -> NifResult<NifTerm<'a
Ok((atoms::ok(), active_relays).encode(env))
}

fn reset<'a>(env: NifEnv<'a>, args: &[NifTerm<'a>]) -> NifResult<NifTerm<'a>> {
fn reset<'a>(env: Env<'a>, args: &[Term<'a>]) -> NifResult<Term<'a>> {
let port: Option<u8> = args[0].decode()?;

match arb::reset(port) {
Expand Down

0 comments on commit e8ae167

Please sign in to comment.