Sha256: 4f5a508f677817f96898a6939dd88e4880bee2b769fe14621f95dfd9e0937f2d

Contents?: true

Size: 360 Bytes

Versions: 3

Compression:

Stored size: 360 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)]
  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

3 entries across 3 versions & 1 rubygems

Version Path
faster_path-0.1.8 src/ruby_array.rs
faster_path-0.1.7 src/ruby_array.rs
faster_path-0.1.6 src/ruby_array.rs