update buffer proto tests

This commit is contained in:
Nikolay Kim 2017-05-19 23:18:54 -07:00
parent 201289d6ca
commit 1f2c927bd5
2 changed files with 6 additions and 6 deletions

View File

@ -86,7 +86,6 @@ extern crate libc;
#[macro_use]
pub extern crate pyo3cls;
pub use pyo3cls as cls;
pub use pyo3cls::*;
pub mod ffi;

View File

@ -7,14 +7,15 @@ use std::ptr;
use std::os::raw::{c_int, c_void};
use pyo3::*;
use pyo3::cls;
py_class!(class TestClass |py| {
data vec: Vec<u8>;
});
#[py::class]
struct TestClass {
vec: Vec<u8>,
}
#[cls::py_impl]
#[py::proto]
impl class::PyBufferProtocol for TestClass {
fn bf_getbuffer(&self, py: Python, view: *mut ffi::Py_buffer, flags: c_int) -> PyResult<()> {