Sha256: 18bcebf6aab14891b798a4cdcd475e4556825619b426196ff93ca5aea75b0b0a

Contents?: true

Size: 361 Bytes

Versions: 4

Compression:

Stored size: 361 Bytes

Contents

use libc;
use std::mem;

#[repr(C)]
pub struct RubyArray {
  len: libc::size_t,
  data: *const libc::c_void,
}

impl RubyArray {
  #[allow(dead_code)]
  pub fn from_vec<T>(vec: Vec<T>) -> RubyArray {
    let array = RubyArray {
      data: vec.as_ptr() as *const libc::c_void,
        len: vec.len() as libc::size_t
    };
    mem::forget(vec);
    array
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
faster_path-0.1.13 src/ruby_array.rs
faster_path-0.1.12 src/ruby_array.rs
faster_path-0.1.11 src/ruby_array.rs
faster_path-0.1.10 src/ruby_array.rs