Skip to content

Commit

Permalink
Upgrade to latest avt
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Apr 1, 2023
1 parent 06f8a12 commit a79e775
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions native/vt_nif/Cargo.lock

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

2 changes: 1 addition & 1 deletion native/vt_nif/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
10 changes: 4 additions & 6 deletions native/vt_nif/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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! {
Expand Down Expand Up @@ -47,11 +47,9 @@ fn dump_screen(env: Env, resource: ResourceArc<VtResource>) -> 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::<Vec<_>>()
})
Expand Down

0 comments on commit a79e775

Please sign in to comment.