From a79e7757573fc8c839da7eb3c958a6fd32af1b82 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Sat, 1 Apr 2023 16:36:10 +0200 Subject: [PATCH] Upgrade to latest avt --- native/vt_nif/Cargo.lock | 4 ++-- native/vt_nif/Cargo.toml | 2 +- native/vt_nif/src/lib.rs | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/native/vt_nif/Cargo.lock b/native/vt_nif/Cargo.lock index 311aa6547..0001117a5 100644 --- a/native/vt_nif/Cargo.lock +++ b/native/vt_nif/Cargo.lock @@ -13,8 +13,8 @@ dependencies = [ [[package]] name = "avt" -version = "0.5.1" -source = "git+https://github.com/asciinema/avt?tag=v0.5.1#917a3b881043fe9a33b42aa10bb374343c37e2cf" +version = "0.6.0" +source = "git+https://github.com/asciinema/avt?tag=v0.6.0#168627cf65999720a6fce122e3419da0147d9296" dependencies = [ "rgb", "serde", diff --git a/native/vt_nif/Cargo.toml b/native/vt_nif/Cargo.toml index 648c3b537..f818286e3 100644 --- a/native/vt_nif/Cargo.toml +++ b/native/vt_nif/Cargo.toml @@ -11,4 +11,4 @@ crate-type = ["dylib"] [dependencies] rustler = "0.27.0" -avt = { git = "https://github.com/asciinema/avt", tag = "v0.5.1" } +avt = { git = "https://github.com/asciinema/avt", tag = "v0.6.0" } diff --git a/native/vt_nif/src/lib.rs b/native/vt_nif/src/lib.rs index ede883af1..f90ae17e1 100644 --- a/native/vt_nif/src/lib.rs +++ b/native/vt_nif/src/lib.rs @@ -1,6 +1,6 @@ +use avt::Vt; use rustler::{Atom, Encoder, Env, Error, NifResult, ResourceArc, Term}; use std::sync::RwLock; -use avt::Vt; mod atoms { rustler::atoms! { @@ -47,11 +47,9 @@ fn dump_screen(env: Env, resource: ResourceArc) -> NifResult<(Atom, let vt = convert_err(resource.vt.read(), "rw_lock")?; let lines = vt - .get_lines() - .into_iter() - .map(|segments| { - segments - .into_iter() + .lines() + .map(|line| { + line.segments() .map(|segment| segment_to_term(segment, env)) .collect::>() })