commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
936efb34fd4a7dc812b7b2fb1051391b1bd78a52 | Toshiki Teramura | 2017-05-07T04:02:25 | Bug fix in address | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index 8af14bdd..ebb61886 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -505,7 +505,7 @@ impl ARRAY_TYPE {
pub unsafe fn as_type_object(self) -> *mut PyTypeObject {
let api = &PyArray_API as *const *const c_void;
ma... | 1 | 1 | 1 |
d8048529cbfb9eda1a56da185a60e052d9baeb98 | Toshiki Teramura | 2017-05-06T11:41:03 | Add documents | diff --git a/src/array.rs b/src/array.rs
index a72d4093..ce0ccd1e 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -26,11 +26,15 @@ impl PyArray {
PyArray(obj)
}
+ /// The number of dimensions in the array
+ /// https://docs.scipy.org/doc/numpy/reference/c-api.array.html#c.PyArray_NDIM
pub fn ... | 1 | 10 | 0 |
081ce74da443a39bd0aa8c7e66a8ebaa8e6d7108 | Toshiki Teramura | 2017-05-06T11:07:50 | Add test of new | diff --git a/tests/array.rs b/tests/array.rs
index 4a61ddbb..3ac41efc 100644
--- a/tests/array.rs
+++ b/tests/array.rs
@@ -5,11 +5,22 @@ extern crate numpy;
use numpy::*;
#[test]
-fn array_shapes() {
- let py = cpython::Python::acquire_gil();
+fn new() {
+ let gil = cpython::Python::acquire_gil();
+ let n ... | 1 | 15 | 4 |
f89420d29593e69b2fd3ab7cbc4de397a9af3222 | Toshiki Teramura | 2017-05-06T11:03:32 | Add short document of zeros/arange | diff --git a/src/array.rs b/src/array.rs
index f79998a7..a72d4093 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -95,6 +95,8 @@ impl PyArray {
}
}
+ /// a wrapper of PyArray_ZEROS
+ /// https://docs.scipy.org/doc/numpy/reference/c-api.array.html#c.PyArray_ZEROS
pub fn zeros(py: Python, dims:... | 1 | 4 | 0 |
ef376547a133e399264361218718f02bd39795da | Toshiki Teramura | 2017-05-06T11:03:23 | Add PyArray::new | diff --git a/src/array.rs b/src/array.rs
index 2a1a35e2..f79998a7 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -77,6 +77,24 @@ impl PyArray {
}
}
+ /// a wrapper of PyArray_SimpleNew
+ /// https://docs.scipy.org/doc/numpy/reference/c-api.array.html#c.PyArray_SimpleNew
+ pub fn new(py: Python... | 1 | 18 | 0 |
a5f9094ec2b0e0454f4ec9864e16fd8e61330736 | Toshiki Teramura | 2017-05-06T11:03:01 | Add as_slice_mut | diff --git a/src/array.rs b/src/array.rs
index d7b6e046..2a1a35e2 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -68,6 +68,15 @@ impl PyArray {
}
}
+ pub fn as_slice_mut<T>(&mut self) -> &mut [T] {
+ let n = self.len();
+ let ptr = self.as_ptr();
+ unsafe {
+ let p = ... | 1 | 9 | 0 |
b9d48d10583dd2d94462255fe82b91e6cb2ae589 | Toshiki Teramura | 2017-05-06T10:23:32 | Add slice/len/arange | diff --git a/src/array.rs b/src/array.rs
index a86ba117..d7b6e046 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -41,6 +41,10 @@ impl PyArray {
dims.into_iter().map(|d| *d as usize).collect()
}
+ pub fn len(&self) -> usize {
+ self.dims().iter().fold(1, |a, b| a * b)
+ }
+
pub fn shap... | 2 | 29 | 0 |
a907048c825cc0a5793f0b8d7341b6ec769ea716 | Toshiki Teramura | 2017-05-04T09:57:08 | Add import test | diff --git a/numpy-test/Cargo.toml b/numpy-test/Cargo.toml
new file mode 100644
index 00000000..1a99c895
--- /dev/null
+++ b/numpy-test/Cargo.toml
@@ -0,0 +1,15 @@
+[package]
+name = "numpy-test"
+version = "0.1.0"
+authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
+
+[lib]
+name = "rust2py"
+crate-type = ["c... | 2 | 39 | 0 |
968043667bcdf5972ec452a5c46b6e2d4939d0f9 | Toshiki Teramura | 2017-05-03T07:55:15 | Test strides | diff --git a/tests/array.rs b/tests/array.rs
index 1f8ddb6c..68cd41a3 100644
--- a/tests/array.rs
+++ b/tests/array.rs
@@ -5,10 +5,23 @@ extern crate numpy;
use numpy::*;
#[test]
-fn array_new() {
+fn array_shapes() {
let py = cpython::Python::acquire_gil();
- let _arr = PyArray::zeros(py.python(),
- ... | 1 | 18 | 5 |
a22f22f28411d34bbd9c1682413d2f908c101fd8 | Toshiki Teramura | 2017-05-03T07:35:03 | Add shape (synonym of dims) | diff --git a/src/array.rs b/src/array.rs
index e19c0e40..a86ba117 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -41,6 +41,10 @@ impl PyArray {
dims.into_iter().map(|d| *d as usize).collect()
}
+ pub fn shape(&self) -> Vec<usize> {
+ self.dims()
+ }
+
pub fn strides(&self) -> Vec<isiz... | 1 | 4 | 0 |
fbe5864dee8acf4bdaf56ea4dc98c6d684a91c2e | Toshiki Teramura | 2017-05-03T07:30:56 | Add accessors: ndim/dims/strides | diff --git a/src/array.rs b/src/array.rs
index ea3cee2c..e19c0e40 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -26,6 +26,31 @@ impl PyArray {
PyArray(obj)
}
+ pub fn ndim(&self) -> usize {
+ let ptr = self.as_ptr();
+ unsafe { (*ptr).nd as usize }
+ }
+
+ pub fn dims(&self) -> ... | 1 | 25 | 0 |
075ff6c8ba9977eb7cb4056af214ff33645d4025 | Toshiki Teramura | 2017-05-03T07:13:19 | Remove new | diff --git a/src/array.rs b/src/array.rs
index 7ed7ae0e..ea3cee2c 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -1,12 +1,9 @@
-use std::ptr::null_mut;
-use std::os::raw::c_void;
-
use npffi;
use pyffi;
use cpython::*;
use npffi::types::npy_intp;
-use super::NPY_TYPES;
+use super::{NPY_TYPES, NPY_ORDER};
pub ... | 3 | 10 | 24 |
2aa212b6ee663fc800eaf056e5f9b31346f4dd6b | Toshiki Teramura | 2017-05-03T07:07:46 | Add zeros | diff --git a/src/array.rs b/src/array.rs
index 6d42eacb..7ed7ae0e 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -29,10 +29,22 @@ impl PyArray {
PyArray(obj)
}
+ pub fn zeros(py: Python, dims: &[usize], typenum: NPY_TYPES, is_fortran_order: i32) -> Self {
+ let dims: Vec<npy_intp> = dims.iter... | 2 | 14 | 2 |
e7361008e2d2a4371ad08a81be02e44125a696c0 | Toshiki Teramura | 2017-05-03T03:33:00 | Fix Type object | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index 3743f4e9..8af14bdd 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -8,55 +8,6 @@ use std::option::Option;
use super::types::*;
use super::iterator::*;
-extern "C" {
- pub static mut PyBigArray_Type: PyTypeObject;
- pub stat... | 1 | 65 | 49 |
b11a7476dd0217402a184ff5cff5d6fc6e23cc5c | Toshiki Teramura | 2017-05-02T16:48:10 | Add test (not passed) | diff --git a/src/lib.rs b/src/lib.rs
index c50fdb9b..627b0d6e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,3 +7,4 @@ pub mod array;
pub mod descr;
pub use npffi::NPY_TYPES;
+pub use array::PyArray;
diff --git a/tests/array.rs b/tests/array.rs
new file mode 100644
index 00000000..410b1796
--- /dev/null
+++ b/tests... | 2 | 10 | 0 |
db093ffcd63471de4ab1e4f3d0cd99a0893372cc | Toshiki Teramura | 2017-05-01T12:17:40 | PyArray::new | diff --git a/src/array.rs b/src/array.rs
index 40991768..881a5b94 100644
--- a/src/array.rs
+++ b/src/array.rs
@@ -1,8 +1,10 @@
use np_ffi;
use py_ffi;
-
use cpython::*;
+use np_ffi::types::npy_intp;
+use std::ptr::null_mut;
+use std::os::raw::c_void;
pub struct PyArray(PyObject);
@@ -15,15 +17,30 @@ impl PyA... | 2 | 23 | 6 |
f42f0a0eb15f5361efca46f2a4b79d3ce856c375 | Toshiki Teramura | 2017-05-01T11:46:38 | Add NPY_TYPES | diff --git a/numpy-sys/src/types.rs b/numpy-sys/src/types.rs
index ee44ef93..ba5f94b7 100644
--- a/numpy-sys/src/types.rs
+++ b/numpy-sys/src/types.rs
@@ -116,6 +116,39 @@ pub enum NPY_DATETIMEUNIT {
NPY_FR_GENERIC = 14,
}
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub enum NPY_TYPES {
+... | 2 | 34 | 1 |
f5694ce56b996ffb9712576be054d7dbe7d0cc61 | Toshiki Teramura | 2017-05-01T10:04:21 | Add PyArrayDescr | diff --git a/src/descr.rs b/src/descr.rs
new file mode 100644
index 00000000..c0d1ee62
--- /dev/null
+++ b/src/descr.rs
@@ -0,0 +1,64 @@
+
+use np_ffi;
+use py_ffi;
+
+use cpython::*;
+
+pub struct PyArrayDescr(PyObject);
+
+impl PyArrayDescr {
+ pub fn as_ptr(&self) -> *mut np_ffi::PyArray_Descr {
+ self.0.a... | 2 | 65 | 0 |
042933d599af613c39d2235972898535419a5438 | Toshiki Teramura | 2017-05-01T09:57:22 | Move to array.rs | diff --git a/src/array.rs b/src/array.rs
new file mode 100644
index 00000000..40991768
--- /dev/null
+++ b/src/array.rs
@@ -0,0 +1,83 @@
+
+use np_ffi;
+use py_ffi;
+
+use cpython::*;
+
+pub struct PyArray(PyObject);
+
+impl PyArray {
+ pub fn as_ptr(&self) -> *mut np_ffi::PyArrayObject {
+ self.0.as_ptr() as... | 2 | 84 | 80 |
6e2908ebd856511373da25aebd280e735fdd969e | Toshiki Teramura | 2017-05-01T08:55:15 | implement cpython traits for PyArray | diff --git a/src/lib.rs b/src/lib.rs
index 3c71f24e..1c1bae5e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,7 +3,7 @@ extern crate python3_sys as py_ffi;
extern crate numpy_sys as np_ffi;
extern crate cpython;
-use cpython::PyObject;
+use cpython::*;
pub struct PyArray(PyObject);
@@ -11,7 +11,75 @@ impl PyArr... | 1 | 69 | 1 |
e03c6c0c54d157d8bb851b6df390c2c8455b909b | Toshiki Teramura | 2017-04-30T09:04:59 | Add PyArray_Check{,Exact} | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index ef5a86e6..3743f4e9 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -1,4 +1,4 @@
-#![allow(non_camel_case_types)]
+#![allow(non_camel_case_types, non_snake_case)]
use libc::FILE;
use pyffi::*;
@@ -9,43 +9,52 @@ use super::types::*... | 1 | 47 | 38 |
90f4dfd4b987ad314e39793390e5d5b94e43a0b1 | Toshiki Teramura | 2017-04-30T08:35:05 | Add Type Objects | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index 01162da9..ef5a86e6 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -8,6 +8,46 @@ use std::option::Option;
use super::types::*;
use super::iterator::*;
+extern "C" {
+ pub static PyBigArray_Type: PyTypeObject;
+ pub static P... | 2 | 44 | 0 |
31bdfadc7a4f518a4bd9ca7320b867626e424155 | Toshiki Teramura | 2017-04-29T07:46:59 | Add pointer access | diff --git a/src/lib.rs b/src/lib.rs
index d20d357b..3c71f24e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,3 +2,16 @@
extern crate python3_sys as py_ffi;
extern crate numpy_sys as np_ffi;
extern crate cpython;
+
+use cpython::PyObject;
+
+pub struct PyArray(PyObject);
+
+impl PyArray {
+ pub fn as_ptr(&self) ->... | 1 | 13 | 0 |
1b3d122229b9e15fdb9db12473b7a48423ff71fb | Toshiki Teramura | 2017-04-27T17:36:09 | Add python3-sys and cpython | diff --git a/Cargo.toml b/Cargo.toml
index bcfa2640..34146f46 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,11 @@ name = "numpy"
version = "0.1.0"
authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
+[dependencies]
+cpython = "0.1"
+python3-sys = "0.1"
+
[dependencies.numpy-sys]
-version = "0.1.0"
+v... | 2 | 9 | 7 |
eb1b9ac452a15875a9b92c41eb0da743c0a37af4 | Toshiki Teramura | 2017-04-28T16:49:45 | Change build dir under target/ | diff --git a/numpy-sys/build.rs b/numpy-sys/build.rs
index ed86fd85..63124a0b 100644
--- a/numpy-sys/build.rs
+++ b/numpy-sys/build.rs
@@ -1,17 +1,18 @@
extern crate glob;
+use std::env::var;
use std::fs::canonicalize;
use std::path::PathBuf;
use std::process::Command;
use glob::glob;
-fn glob1(regex: &str) ... | 1 | 14 | 5 |
286693fb5a204e2e97518b16a13d20dd28b38499 | Toshiki Teramura | 2017-04-27T10:36:39 | BUILD: Use python3 | diff --git a/numpy-sys/build.rs b/numpy-sys/build.rs
index e570f446..ed86fd85 100644
--- a/numpy-sys/build.rs
+++ b/numpy-sys/build.rs
@@ -6,8 +6,12 @@ use std::path::PathBuf;
use std::process::Command;
use glob::glob;
+fn glob1(regex: &str) -> PathBuf {
+ glob(regex).unwrap().last().unwrap().unwrap()
+}
+
fn s... | 1 | 7 | 3 |
dc325f12bd38b85f04164fcd639794d0a733fc22 | Toshiki Teramura | 2017-04-27T10:19:19 | Fix build script | diff --git a/numpy-sys/build.rs b/numpy-sys/build.rs
index 2bf6ac3a..e570f446 100644
--- a/numpy-sys/build.rs
+++ b/numpy-sys/build.rs
@@ -6,33 +6,28 @@ use std::path::PathBuf;
use std::process::Command;
use glob::glob;
-
fn search_lib(libpath: &PathBuf, regex: &str) -> PathBuf {
glob(libpath.join(regex).to_s... | 1 | 13 | 18 |
5ec6c3c7a2ab6e10469cfbbcb7750a236d155670 | Toshiki Teramura | 2017-04-27T10:13:49 | Add link to umath | diff --git a/numpy-sys/build.rs b/numpy-sys/build.rs
index 6e91a7a3..2bf6ac3a 100644
--- a/numpy-sys/build.rs
+++ b/numpy-sys/build.rs
@@ -7,22 +7,33 @@ use std::process::Command;
use glob::glob;
+fn search_lib(libpath: &PathBuf, regex: &str) -> PathBuf {
+ glob(libpath.join(regex).to_str().unwrap()).unwrap().l... | 3 | 30 | 33 |
b1abea796731d04f41af0e4e6e64ca7d25bca966 | Toshiki Teramura | 2017-04-27T10:03:19 | pyufunc_api! | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index d407ac5f..01162da9 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -8,22 +8,6 @@ use std::option::Option;
use super::types::*;
use super::iterator::*;
-extern "C" {
- pub static PyArray_API: *const c_void;
-}
-
-macro_rules! p... | 2 | 71 | 101 |
5cac728da1b774635acd85e32c38c56e4a7aff7b | Toshiki Teramura | 2017-04-27T09:45:50 | Rewrit Array API using pyarray_api! macro | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index a3a35b51..d407ac5f 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -12,6 +12,18 @@ extern "C" {
pub static PyArray_API: *const c_void;
}
+macro_rules! pyarray_api {
+ [ $offset:expr; $fname:ident ( $($arg:ident : $t:ty),* ... | 1 | 269 | 257 |
4a7604c28c576c4deaabb29f58020d52a32f7d9f | Toshiki Teramura | 2017-04-27T08:51:14 | Test for PyArray_Arange (fail) | diff --git a/numpy-sys/tests/array.rs b/numpy-sys/tests/array.rs
index 6eae3bb5..9a5e1509 100644
--- a/numpy-sys/tests/array.rs
+++ b/numpy-sys/tests/array.rs
@@ -2,6 +2,7 @@
extern crate python3_sys as pyffi;
extern crate numpy_sys;
+use pyffi::*;
use numpy_sys::*;
use std::os::raw::c_void;
@@ -10,12 +11,19 @@... | 1 | 10 | 2 |
a79ee658c48573eb5d9bc3d674c4594b95ae5cbe | Toshiki Teramura | 2017-04-27T08:32:11 | API can be called (exclude functions which get/return PyObject*) | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index d43682de..a3a35b51 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -9,7 +9,7 @@ use super::types::*;
use super::iterator::*;
extern "C" {
- pub static PyArray_API: *const *const c_void;
+ pub static PyArray_API: *const c_vo... | 2 | 14 | 3 |
1fa56c0fe591dd1fbce992e79e8b00ee01559bb4 | Toshiki Teramura | 2017-04-26T17:08:33 | Use canonicalize libdir | diff --git a/numpy-sys/Cargo.toml b/numpy-sys/Cargo.toml
index a4d589a2..a23a59af 100644
--- a/numpy-sys/Cargo.toml
+++ b/numpy-sys/Cargo.toml
@@ -4,7 +4,6 @@ version = "0.1.0"
authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
build = "build.rs"
-links = "multiarray"
[dependencies]
libc = "0.2.21"
dif... | 2 | 2 | 2 |
4bb4ea3d8176a0f04a4f6c4f21ac867d7f1293a4 | Toshiki Teramura | 2017-04-25T12:19:12 | Link to multiarray | diff --git a/numpy-sys/Cargo.toml b/numpy-sys/Cargo.toml
index bf3b26c2..bbb13354 100644
--- a/numpy-sys/Cargo.toml
+++ b/numpy-sys/Cargo.toml
@@ -3,6 +3,12 @@ name = "numpy-sys"
version = "0.1.0"
authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
+build = "build.rs"
+links = "multiarray"
+
[dependencies]... | 2 | 36 | 0 |
26de465f224c363debc24c103466dbbafe5fc0d9 | Toshiki Teramura | 2017-04-25T06:55:18 | Add test to check the link succeeds | diff --git a/numpy-sys/src/lib.rs b/numpy-sys/src/lib.rs
index 3b9ff16b..977422a7 100644
--- a/numpy-sys/src/lib.rs
+++ b/numpy-sys/src/lib.rs
@@ -6,3 +6,8 @@ pub mod types;
pub mod array;
pub mod iterator;
pub mod ufunc;
+
+pub use types::*;
+pub use array::*;
+pub use iterator::*;
+pub use ufunc::*;
diff --git a/n... | 2 | 15 | 0 |
6f8f5d13e8f04f574bd2c8b39e57d31f7bed4dcb | Toshiki Teramura | 2017-04-25T04:48:04 | Add ufunc API | diff --git a/numpy-sys/src/ufunc.rs b/numpy-sys/src/ufunc.rs
index 2c317690..0469bbff 100644
--- a/numpy-sys/src/ufunc.rs
+++ b/numpy-sys/src/ufunc.rs
@@ -81,3 +81,91 @@ pub type PyUFunc_MaskedInnerLoopSelectionFunc = Option<unsafe extern "C" fn(ufun
... | 1 | 88 | 0 |
5f600f6b57647d94a54777be6da5fb5b59a7b6d7 | Toshiki Teramura | 2017-04-25T03:04:34 | Clean up | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index 63b75267..731bdce7 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -4,14 +4,6 @@ use libc::FILE;
use pyffi::*;
use super::types::*;
-#[repr(u32)]
-#[derive(Copy, Clone, PartialEq, Eq, Hash)]
-pub enum NPY_CLIPMODE {
- NPY_CLIP... | 3 | 8 | 10 |
9c705043f69494f7c2b4594ebd06cfe8857e8520 | Toshiki Teramura | 2017-04-24T17:55:22 | Remove duplicated NPY_CASTING | diff --git a/numpy-sys/src/ufunc.rs b/numpy-sys/src/ufunc.rs
index bfab03b1..2688691d 100644
--- a/numpy-sys/src/ufunc.rs
+++ b/numpy-sys/src/ufunc.rs
@@ -5,16 +5,6 @@ use pyffi::*;
use super::types::*;
use super::array::*;
-#[repr(u32)]
-#[derive(Copy, Clone, PartialEq, Eq, Hash)]
-pub enum NPY_CASTING {
- NPY_... | 1 | 0 | 10 |
2f34b170912d506b450ac1e7eaabfe41b58d4684 | Toshiki Teramura | 2017-04-24T17:45:22 | Merge extern "C" {} | diff --git a/numpy-sys/src/multiarray.rs b/numpy-sys/src/multiarray.rs
index 35e5fbf7..125a3ef7 100644
--- a/numpy-sys/src/multiarray.rs
+++ b/numpy-sys/src/multiarray.rs
@@ -7,129 +7,69 @@ use super::arrayiter::*;
extern "C" {
pub fn PyArray_GetNDArrayCVersion() -> ::std::os::raw::c_uint;
-}
-extern "C" {
... | 1 | 0 | 510 |
112bd285b6a4d0535740d66f7a6e647691a3022e | Toshiki Teramura | 2017-04-24T05:28:04 | Clean up array.rs | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index 7fd404e6..63b75267 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -12,13 +12,6 @@ pub enum NPY_CLIPMODE {
NPY_RAISE = 2,
}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct _object {
- pub ob_refcnt: Py_ssize_t,
- pub ob... | 1 | 3 | 10 |
2ad5c7108d0229a1728a51f1c40ff9ffb21a88d9 | Toshiki Teramura | 2017-04-21T13:21:29 | Remove duplicated | diff --git a/numpy-sys/src/arrayiter.rs b/numpy-sys/src/arrayiter.rs
index d5b2b561..a557d4e9 100644
--- a/numpy-sys/src/arrayiter.rs
+++ b/numpy-sys/src/arrayiter.rs
@@ -5,7 +5,6 @@ use pyffi::*;
use super::types::*;
use super::array::*;
-pub type npy_bool = ::std::os::raw::c_uchar;
pub type npy_iter_get_dataptr_... | 1 | 0 | 1 |
5f65d8e30ba2ef8e5c1ec503c6e66c8c91634cdb | Toshiki Teramura | 2017-04-21T13:19:34 | Remove duplicated codes | diff --git a/numpy-sys/src/array.rs b/numpy-sys/src/array.rs
index 6b7f1e56..7fd404e6 100644
--- a/numpy-sys/src/array.rs
+++ b/numpy-sys/src/array.rs
@@ -1,7 +1,7 @@
#![allow(non_camel_case_types)]
-use pyffi::*;
use libc::FILE;
+use pyffi::*;
use super::types::*;
#[repr(u32)]
@@ -19,15 +19,6 @@ pub struct _ob... | 2 | 2 | 118 |
154b1ddb741b4500a6db4821c62317b01839d355 | Toshiki Teramura | 2017-04-21T13:12:37 | Add PyAsyncMethods | diff --git a/numpy-sys/Cargo.toml b/numpy-sys/Cargo.toml
index 429c74b0..bf3b26c2 100644
--- a/numpy-sys/Cargo.toml
+++ b/numpy-sys/Cargo.toml
@@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
[dependencies]
-libc = "*"
-python3-sys = "*"
+libc = "0.2.21"
+python3-sys = "... | 2 | 51 | 2 |
95f2b264fd78a5715f82b331602aafec793fda0e | Toshiki Teramura | 2017-04-21T13:02:34 | Rename submodules | diff --git a/numpy-sys/src/pyarray.rs b/numpy-sys/src/array.rs
similarity index 100%
rename from numpy-sys/src/pyarray.rs
rename to numpy-sys/src/array.rs
diff --git a/numpy-sys/src/pyarrayiter.rs b/numpy-sys/src/arrayiter.rs
similarity index 98%
rename from numpy-sys/src/pyarrayiter.rs
rename to numpy-sys/src/arrayite... | 4 | 6 | 8 |
5021844c766a1841fe37cf184fee5d8aa951a20c | Toshiki Teramura | 2017-04-21T13:00:49 | Add types | diff --git a/numpy-sys/src/lib.rs b/numpy-sys/src/lib.rs
index a218317b..ab2639d4 100644
--- a/numpy-sys/src/lib.rs
+++ b/numpy-sys/src/lib.rs
@@ -2,6 +2,7 @@
extern crate libc;
extern crate python3_sys as pyffi;
+pub mod types;
pub mod pyarray;
pub mod pyarrayiter;
pub mod pyufunc;
diff --git a/numpy-sys/src/py... | 4 | 64 | 4 |
f66ca26d8f91513962a75a9ba99305a6c51780d5 | Toshiki Teramura | 2017-04-21T12:47:11 | PyArrayInterface | diff --git a/numpy-sys/src/pyarray.rs b/numpy-sys/src/pyarray.rs
index f46c0172..f47b28ce 100644
--- a/numpy-sys/src/pyarray.rs
+++ b/numpy-sys/src/pyarray.rs
@@ -56,6 +56,20 @@ pub struct PyArray_Chunk {
pub flags: ::std::os::raw::c_int,
}
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct PyArrayInterface {
+ ... | 1 | 14 | 0 |
624eff2ac1f8d7cf863255cdf2a5f09e7351ffd9 | Toshiki Teramura | 2017-04-21T12:46:09 | PyArray_{Dims,Chunk}, PyArrayFlagsObject | diff --git a/numpy-sys/src/pyarray.rs b/numpy-sys/src/pyarray.rs
index 7f295278..f46c0172 100644
--- a/numpy-sys/src/pyarray.rs
+++ b/numpy-sys/src/pyarray.rs
@@ -31,6 +31,31 @@ pub struct PyMethodDef {
pub ml_doc: *const ::std::os::raw::c_char,
}
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct PyArrayFlagsObje... | 1 | 25 | 0 |
226148d586871fc6224d2abe3166265e26a2ab9c | Toshiki Teramura | 2017-04-21T12:43:30 | PyArrayNeighborhoodIterObject | diff --git a/numpy-sys/src/pyarrayiter.rs b/numpy-sys/src/pyarrayiter.rs
index 10ef9ead..31cf83de 100644
--- a/numpy-sys/src/pyarrayiter.rs
+++ b/numpy-sys/src/pyarrayiter.rs
@@ -42,3 +42,29 @@ pub struct PyArrayMultiIterObject {
pub dimensions: [npy_intp; 32usize],
pub iters: [*mut PyArrayIterObject; 32usize... | 1 | 26 | 0 |
e0c898d34c1b0e454847ae555c2136777465c1e0 | Toshiki Teramura | 2017-04-21T06:30:20 | Add PyArrayMultiIterObject | diff --git a/numpy-sys/src/pyarrayiter.rs b/numpy-sys/src/pyarrayiter.rs
index 38244c97..10ef9ead 100644
--- a/numpy-sys/src/pyarrayiter.rs
+++ b/numpy-sys/src/pyarrayiter.rs
@@ -30,3 +30,15 @@ pub struct PyArrayIterObject {
pub limits_sizes: [npy_intp; 32usize],
pub translate: npy_iter_get_dataptr_t,
}
+
+#... | 1 | 12 | 0 |
edea387fc3f96c86b7e3087a6ed47e3593ffd923 | Toshiki Teramura | 2017-04-21T06:27:42 | Add PyArrayIterObject | diff --git a/numpy-sys/src/lib.rs b/numpy-sys/src/lib.rs
index 8475489d..a218317b 100644
--- a/numpy-sys/src/lib.rs
+++ b/numpy-sys/src/lib.rs
@@ -3,4 +3,5 @@ extern crate libc;
extern crate python3_sys as pyffi;
pub mod pyarray;
+pub mod pyarrayiter;
pub mod pyufunc;
diff --git a/numpy-sys/src/pyarray.rs b/numpy-... | 3 | 35 | 4 |
c74bacddd5c4fbbb2c1ed2d26b0c2fb756264c44 | Toshiki Teramura | 2017-04-21T06:16:39 | Add PyUFunc* and relates | diff --git a/numpy-sys/src/lib.rs b/numpy-sys/src/lib.rs
index 2b8349f6..8475489d 100644
--- a/numpy-sys/src/lib.rs
+++ b/numpy-sys/src/lib.rs
@@ -3,3 +3,4 @@ extern crate libc;
extern crate python3_sys as pyffi;
pub mod pyarray;
+pub mod pyufunc;
diff --git a/numpy-sys/src/pyufunc.rs b/numpy-sys/src/pyufunc.rs
new... | 2 | 108 | 0 |
75bcff59c35b367c03a1ba1defc36b02eacfcf0e | Toshiki Teramura | 2017-04-21T06:15:44 | Split PyArray* and related function from lib.rs | diff --git a/numpy-sys/src/lib.rs b/numpy-sys/src/lib.rs
index 23891bc9..2b8349f6 100644
--- a/numpy-sys/src/lib.rs
+++ b/numpy-sys/src/lib.rs
@@ -1,304 +1,5 @@
-#![allow(non_camel_case_types)]
-// FIXME ^ should be removed
extern crate libc;
extern crate python3_sys as pyffi;
-use pyffi::*;
-use libc::FILE;
-
-p... | 2 | 303 | 300 |
d7a801fbec5945dbb5634f8c2c1c25c1a62d1a0f | Toshiki Teramura | 2017-04-21T05:54:10 | Ready for safe wrapper crate (generated by cargo) | diff --git a/Cargo.toml b/Cargo.toml
index f19cc22e..bcfa2640 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,3 +2,8 @@
name = "numpy"
version = "0.1.0"
authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
+
+[dependencies.numpy-sys]
+version = "0.1.0"
+path = "numpy-sys"
+ | 1 | 5 | 0 |
3bf30f7d6a5c180136eb3dfba6b2bc733ec17965 | Toshiki Teramura | 2017-04-21T05:46:08 | Add allow cfg to reduce warning | diff --git a/numpy-sys/src/lib.rs b/numpy-sys/src/lib.rs
index 67422b24..23891bc9 100644
--- a/numpy-sys/src/lib.rs
+++ b/numpy-sys/src/lib.rs
@@ -1,3 +1,5 @@
+#![allow(non_camel_case_types)]
+// FIXME ^ should be removed
extern crate libc;
extern crate python3_sys as pyffi; | 1 | 2 | 0 |
5a6eef24c824790b0a06a11f0481a87c39c002ff | Toshiki Teramura | 2017-04-20T17:36:03 | Use python3-sys | diff --git a/numpy-sys/Cargo.toml b/numpy-sys/Cargo.toml
index ce8a7bf1..429c74b0 100644
--- a/numpy-sys/Cargo.toml
+++ b/numpy-sys/Cargo.toml
@@ -5,4 +5,4 @@ authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
[dependencies]
libc = "*"
-cpython = "*"
+python3-sys = "*"
diff --git a/numpy-sys/src/lib.rs b/n... | 2 | 3 | 3 |
f4ff6554c8297d9443e661f3eb09c20cec510a87 | Toshiki Teramura | 2017-04-20T17:28:56 | Add subcrate numpy-sys | diff --git a/numpy-sys/Cargo.toml b/numpy-sys/Cargo.toml
new file mode 100644
index 00000000..ce8a7bf1
--- /dev/null
+++ b/numpy-sys/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "numpy-sys"
+version = "0.1.0"
+authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
+
+[dependencies]
+libc = "*"
+cpython = "*"
diff... | 2 | 310 | 0 |
e0ebd3820adce8680a195a5fbe6cb0be868478c6 | Georg Semmler | 2025-12-16T13:55:37 | Fix warnings | diff --git a/src/error.rs b/src/error.rs
index f403521..5670b25 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -73,7 +73,7 @@ where
F: fmt::Display + 's,
{
type Format = &'s F;
- fn into_info(&'s self) -> Info<T, R, <Self as ErrorInfo<'_, T, R>>::Format> {
+ fn into_info(&'s self) -> Info<T, R, <Self ... | 2 | 2 | 1 |
bfae6afcf5ec0476e2f38ef3c37d708925c28b82 | Georg Semmler | 2025-12-16T13:53:22 | Exclude development scripts from published package
During a dependency review we noticed that the combine crate includes various development scripts. These development scripts shouldn't be there as they might, at some point become problematic. As of now they prevent any downstream user from enabling the `[bans.build.i... | diff --git a/Cargo.toml b/Cargo.toml
index 0e53c72..e360445 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,6 +17,7 @@ categories = ["parsing", "no-std"]
license = "MIT"
edition = "2018"
+include = ["Cargo.toml", "README.md", "CHANGELOG.md", "LICENSE", "src/**/*.rs"]
[package.metadata.docs.rs]
all-features = tr... | 1 | 1 | 0 |
f726b8f943f44d258686911907c0324771a2d09f | Markus Westerlind | 2024-04-10T09:56:16 | chore: Release combine version 4.6.7 | diff --git a/Cargo.lock b/Cargo.lock
index 3eeb3db..e617874 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -310,7 +310,7 @@ dependencies = [
[[package]]
name = "combine"
-version = "4.6.6"
+version = "4.6.7"
dependencies = [
"async-std",
"bytes 0.5.6",
diff --git a/Cargo.toml b/Cargo.toml
index 248ceb6..0e53c72 1... | 2 | 2 | 2 |
5e6bbed5fb548fee9fb1a4767810bbc4ed009720 | Artem Rakov | 2024-04-10T01:54:01 | perf: avoid initializing huge buffers | diff --git a/Cargo.toml b/Cargo.toml
index c301500..248ceb6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -86,6 +86,11 @@ name = "mp4"
harness = false
required-features = ["mp4"]
+[[bench]]
+name = "buffers"
+harness = false
+required-features = ["std"]
+
[[example]]
name = "async"
required-features = ["std", "tok... | 3 | 96 | 6 |
b3c770f9bd43db7b4197225566bf9d951887c2b3 | Markus Westerlind | 2024-01-03T11:56:00 | doc: Add documentation to no_partial | diff --git a/src/parser/combinator.rs b/src/parser/combinator.rs
index e7a7ba1..97bae9a 100644
--- a/src/parser/combinator.rs
+++ b/src/parser/combinator.rs
@@ -664,6 +664,30 @@ where
forward_parser!(Input, add_error add_committed_expected_error parser_count, 0);
}
+/// Wraps a parser `p` and disables partial p... | 2 | 26 | 0 |
9bc45f773c6a7773b7ad83ab838d060701d0580c | Augusto F. Hack | 2023-12-10T23:13:29 | docs: remove mention to nightly
Return position impl was enabled in Rust 1.26 in May 10, 2018 [1].
1- https://blog.rust-lang.org/2018/05/10/Rust-1.26.html#impl-trait | diff --git a/src/lib.rs b/src/lib.rs
index a58d834..04faeda 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -84,10 +84,10 @@
//! If we need a parser that is mutually recursive or if we want to export a reusable parser the
//! [`parser!`] macro can be used. In effect it makes it possible to return a parser without naming
... | 1 | 6 | 6 |
71ac3e502697ffb679554543e921bf9e816d23b2 | Markus Westerlind | 2023-04-04T10:55:17 | test: Fix readme tests | diff --git a/tests/async.rs b/tests/async.rs
index bedaa72..7351f4d 100644
--- a/tests/async.rs
+++ b/tests/async.rs
@@ -634,7 +634,7 @@ fn skip_count_min_max_test() {
assert_eq!(result.unwrap(), [""]);
}
-const WORDS_IN_README: usize = 824;
+const WORDS_IN_README: usize = 773;
#[test]
fn decode_std() {
@@ ... | 1 | 2 | 2 |
1fabe27998a9bdd205afb5068b6fc527151f3c98 | Markus Westerlind | 2023-03-31T08:53:32 | chore: Fix tests | diff --git a/Cargo.lock b/Cargo.lock
index 1900e9c..5d0cdf5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,18 +4,18 @@ version = 3
[[package]]
name = "aho-corasick"
-version = "0.7.18"
+version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca578... | 2 | 337 | 300 |
d73b6e4c93ead1e67ed2607e98b2e76baab37f2d | Tim Siegel | 2022-09-11T21:33:18 | Remove extraneous Input::Error trait bounds
Due to an old Rust bug, rust-lang/rust#24159, many parsers included an
extraneous trait bound for Input::Error as a workaround. That bug has
been closed since February 2021, and the workaround is no longer needed. | diff --git a/benches/http.rs b/benches/http.rs
index e08e973..187b4eb 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -74,7 +74,6 @@ fn is_http_version(c: u8) -> bool {
fn end_of_line<'a, Input>() -> impl Parser<Input, Output = u8>
where
Input: RangeStream<Token = u8, Range = &'a [u8]>,
- Input::Error: ... | 15 | 8 | 81 |
3f59f9d9173ffc8d017a7eed7dc52c128ba5159c | Markus Westerlind | 2022-08-17T09:53:22 | chore: Remove outdated comment | diff --git a/benches/json.rs b/benches/json.rs
index 56add8e..5e7b8eb 100644
--- a/benches/json.rs
+++ b/benches/json.rs
@@ -1,6 +1,3 @@
-// `impl Trait` is not required for this parser but we use to to show that it can be used to
-// significantly simplify things
-
#![cfg(feature = "std")]
#[macro_use] | 1 | 0 | 3 |
cbc33e72627eac452806240d4bdb948465a4cbe1 | Markus Westerlind | 2022-08-09T16:42:41 | (cargo-release) version 4.6.6 | diff --git a/Cargo.lock b/Cargo.lock
index 1f2baef..1900e9c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -257,7 +257,7 @@ dependencies = [
[[package]]
name = "combine"
-version = "4.6.5"
+version = "4.6.6"
dependencies = [
"async-std",
"bytes 0.5.6",
diff --git a/Cargo.toml b/Cargo.toml
index ae60426..c301500 1... | 2 | 2 | 2 |
2d308d718ea3dd43834cfccec1f03f30537c1410 | Markus Westerlind | 2022-08-09T16:41:20 | (cargo-release) version 4.6.5 | diff --git a/Cargo.lock b/Cargo.lock
index 5da565b..1f2baef 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "aho-corasick"
version = "0.7.18"
@@ -255,7 +257,7 @@ dependencies = [
... | 2 | 4 | 2 |
1e4bfd49e25a5fe08073a067c29255dbe3d82110 | klensy | 2022-07-28T11:01:31 | memchr: use non deprecated feature `std` instead of `use_std`
https://github.com/BurntSushi/memchr/commit/8efd67fcc412445d6978cf35761ab81ed2d6e6fe | diff --git a/Cargo.toml b/Cargo.toml
index 5d31969..46986b1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ path = "src/lib.rs"
[dependencies]
regex = { version = "1", optional = true }
-memchr = { version = "2.2", default-features = false }
+memchr = { version = "2.3", default-features = false }
pin-pr... | 1 | 2 | 2 |
5ff32f1313792892b5dbcb81dc6e432433381642 | Markus Westerlind | 2022-08-09T08:48:54 | refactor: Extract less-generic code from sequence's add_errors (-5%)
On the date example | diff --git a/src/parser/sequence.rs b/src/parser/sequence.rs
index 1c8bdcb..166b89d 100644
--- a/src/parser/sequence.rs
+++ b/src/parser/sequence.rs
@@ -14,17 +14,6 @@ use crate::{
ErrorOffset, Parser, Stream, StreamOnce,
};
-macro_rules! dispatch_on {
- ($i: expr, $f: expr;) => {
- };
- ($i: expr, $f:... | 1 | 43 | 30 |
8208044ca9dee82fb857cbfea4163b85f5ee424c | sadness_ojisan | 2022-04-25T15:32:20 | Update test using README | diff --git a/src/stream/mod.rs b/src/stream/mod.rs
index ff9780e..b1f3d07 100644
--- a/src/stream/mod.rs
+++ b/src/stream/mod.rs
@@ -1401,7 +1401,7 @@ where
/// },
/// |input, _position| combine::easy::Stream::from(input),
/// ).map_err(combine::easy::Errors::<u8, &[u8], _>::from),
-/// Ok(81... | 2 | 7 | 7 |
50a71afa1c88e8564e0220a6e0625dd16a2302a2 | Markus Westerlind | 2022-04-25T10:16:15 | (cargo-release) version 4.6.4 | diff --git a/Cargo.lock b/Cargo.lock
index ca561d3..b23775e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -257,7 +257,7 @@ dependencies = [
[[package]]
name = "combine"
-version = "4.6.3"
+version = "4.6.4"
dependencies = [
"async-std",
"bytes 0.5.6",
diff --git a/Cargo.toml b/Cargo.toml
index 1b45cc4..5d31969 1... | 2 | 2 | 2 |
a5daddffa5a72b8b4618dfed9d215143c27948c7 | Dirkjan Ochtman | 2022-03-28T09:40:27 | Fix some warnings in benchmark code | diff --git a/benches/http.rs b/benches/http.rs
index 68414a5..e08e973 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -17,6 +17,7 @@ use {
criterion::{black_box, Bencher, Criterion},
};
+#[allow(dead_code)]
#[derive(Debug)]
struct Request<'a> {
method: &'a [u8],
@@ -24,6 +25,7 @@ struct Request<'a>... | 1 | 2 | 0 |
c0899a6431a4602bb2959f1c0ff817829a3fb475 | Dirkjan Ochtman | 2022-03-28T09:39:57 | Upgrade to tokio-util 0.7 | diff --git a/Cargo.lock b/Cargo.lock
index cbeca87..ca561d3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1204,9 +1204,9 @@ dependencies = [
[[package]]
name = "tokio-util"
-version = "0.6.8"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d3725d3efa29485e87311c5b6... | 2 | 3 | 3 |
d6e806f328520d8d5e11425da2b495a8b083393c | Til Blechschmidt | 2022-02-15T00:31:24 | Update feature-flag in documentation
It appears that the feature flag has been changed from `std` to `alloc` some time in the past. However, the corresponding documentation attribute has been left unchanged. | diff --git a/src/stream/mod.rs b/src/stream/mod.rs
index 803e9a8..ff9780e 100644
--- a/src/stream/mod.rs
+++ b/src/stream/mod.rs
@@ -53,7 +53,7 @@ pub mod buf_reader;
/// Stream wrapper which provides a `ResetStream` impl for `StreamOnce` impls which do not have
/// one.
#[cfg(feature = "alloc")]
-#[cfg_attr(docsrs,... | 1 | 1 | 1 |
84ceb76d89f267dcffe2802b336f88b451cdc01f | Markus Westerlind | 2022-01-12T19:03:32 | (cargo-release) version 4.6.3 | diff --git a/Cargo.lock b/Cargo.lock
index 88af87f..cbeca87 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -257,7 +257,7 @@ dependencies = [
[[package]]
name = "combine"
-version = "4.6.2"
+version = "4.6.3"
dependencies = [
"async-std",
"bytes 0.5.6",
diff --git a/Cargo.toml b/Cargo.toml
index 918b7a4..ba58238 1... | 2 | 2 | 2 |
08962d1d4287c03edb84bd73a9eb09a42f294bc8 | Ed Page | 2022-01-11T15:53:46 | fix(easy): Only back-quote parser tokens
When reviewing cargo moving fron `toml-rs` (hand-rolled parser) to
`toml_edit` (`combine`-based parser), one piece of feedback was about
only wanting tokens quoted and not textual descriptions. It looks like
`combine` tracks all of the needed information and just a re-formatti... | diff --git a/src/lib.rs b/src/lib.rs
index ab46d81..77e3e23 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -25,7 +25,7 @@
//! use combine::parser::char::{digit, letter};
//! const MSG: &'static str = r#"Parse error at line: 1, column: 1
//! Unexpected `|`
-//! Expected `digit` or `letter`
+//! Expected digit or letter
... | 2 | 7 | 7 |
63277be79ca02413a47fe2773161d889090d8746 | xhe | 2021-11-22T17:05:18 | fix compiling error for futures | diff --git a/src/stream/buf_reader.rs b/src/stream/buf_reader.rs
index 9c629ea..fa7b928 100644
--- a/src/stream/buf_reader.rs
+++ b/src/stream/buf_reader.rs
@@ -1,7 +1,7 @@
use std::io::{self, BufRead, Read};
#[cfg(any(
- features = "futures-03",
+ feature = "futures-03",
feature = "tokio-02",
featu... | 1 | 2 | 2 |
fdd63e2a8635c00c5c2fe1d18110958178376310 | Markus Westerlind | 2021-10-28T13:25:54 | chore: cargo update | diff --git a/Cargo.lock b/Cargo.lock
index 2f6474a..88af87f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,18 +4,18 @@ version = 3
[[package]]
name = "aho-corasick"
-version = "0.7.15"
+version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7404febffaa47dac81aa44dba71523c9... | 1 | 251 | 289 |
9af8fda19801215163fe07b9c69b68e0efe3272e | Markus Westerlind | 2021-10-28T13:21:03 | (cargo-release) version 4.6.2 | diff --git a/Cargo.lock b/Cargo.lock
index aa607e6..2f6474a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -268,7 +268,7 @@ dependencies = [
[[package]]
name = "combine"
-version = "4.6.2-alpha.0"
+version = "4.6.2"
dependencies = [
"async-std",
"bytes 0.5.6",
diff --git a/Cargo.toml b/Cargo.toml
index e524d56..9... | 2 | 2 | 2 |
03b19498189c873cdf8195a207a9f5a747ca40b7 | Markus Westerlind | 2021-10-28T11:00:31 | perf: Handle restarts better in take_until_byte{,s,2,3}
These were ignoring the `PartialState` from `take_fn` which would cause
them to resume parsing from the start of the "haystack" on every
restart. Fixing the type signature will cause them to retain the `usize`
state that `take_fn` uses to skip ahead.
Fixes #327 | diff --git a/src/parser/byte.rs b/src/parser/byte.rs
index b28d362..c70769d 100644
--- a/src/parser/byte.rs
+++ b/src/parser/byte.rs
@@ -311,6 +311,7 @@ macro_rules! take_until {
parser!{
#[derive(Clone)]
pub struct $type_name;
+ type PartialState = usize;
$(#[... | 1 | 2 | 0 |
08753d3ebf072c0765e99bd6f440b52ef93cab40 | Fangdun Tsai | 2021-09-20T07:58:42 | fix: warning | diff --git a/src/parser/char.rs b/src/parser/char.rs
index b132910..e93b446 100644
--- a/src/parser/char.rs
+++ b/src/parser/char.rs
@@ -271,7 +271,6 @@ where
/// # extern crate combine;
/// # use combine::*;
/// # use combine::parser::char::string_cmp;
-/// use std::ascii::AsciiExt;
/// # fn main() {
/// let resu... | 2 | 8 | 2 |
31ba37d8311d19e7534aafd0a2000731ee069a25 | Markus Westerlind | 2021-08-25T14:20:59 | (cargo-release) start next development iteration 4.6.2-alpha.0 | diff --git a/Cargo.lock b/Cargo.lock
index 843b88f..aa607e6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -268,7 +268,7 @@ dependencies = [
[[package]]
name = "combine"
-version = "4.6.1"
+version = "4.6.2-alpha.0"
dependencies = [
"async-std",
"bytes 0.5.6",
diff --git a/Cargo.toml b/Cargo.toml
index f2517e6..e... | 2 | 2 | 2 |
cd35e54a4e9c555da87984fa665542e31f04e306 | Markus Westerlind | 2021-08-25T14:20:36 | (cargo-release) version 4.6.1 | diff --git a/Cargo.lock b/Cargo.lock
index b9c8ab3..843b88f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "aho-corasick"
version = "0.7.15"
@@ -266,7 +268,7 @@ dependencies = [
... | 2 | 4 | 2 |
1c16962f0bcfd3b359811b48999a80cd1af3fc3f | Arsenii Lyashenko | 2021-08-23T13:56:22 | Compile `http` only with `std` feature | diff --git a/Cargo.toml b/Cargo.toml
index b4183c0..144cc7c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -79,7 +79,7 @@ required-features = ["std"]
[[bench]]
name = "http"
harness = false
-required-features = ["alloc"]
+required-features = ["std"]
[[bench]]
name = "mp4"
diff --git a/benches/http.rs b/benches/http... | 2 | 2 | 2 |
4c8a2f9c189347d711ddf73d12af7a3cfdbc5a56 | Arsenii Lyashenko | 2021-08-23T13:51:09 | Revert "Make `stream::easy` module usable with `alloc` crate"
This reverts commit a77674e4 | diff --git a/src/lib.rs b/src/lib.rs
index b643e8b..b5e75f3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -201,7 +201,7 @@ extern crate alloc;
#[doc(inline)]
pub use crate::error::{ParseError, ParseResult, StdParseResult};
-#[cfg(feature = "alloc")]
+#[cfg(feature = "std")]
#[doc(inline)]
pub use crate::parser::Eas... | 4 | 7 | 27 |
75ce7f6c08adc3cad8855d810cb604c26a52eb3c | Arsenii Lyashenko | 2021-08-15T12:29:24 | Give more precise name to type alias | diff --git a/tests/parser.rs b/tests/parser.rs
index c36651b..4721825 100644
--- a/tests/parser.rs
+++ b/tests/parser.rs
@@ -86,10 +86,10 @@ mod tests_std {
#[test]
fn sep_by_committed_error() {
- type TwoLetters = Vec<(char, char)>;
+ type TwoLettersList = Vec<(char, char)>;
let mu... | 1 | 2 | 2 |
cbed50c1cd34705dd09166c7b3d6ef79417e0f2d | Arsenii Lyashenko | 2021-08-15T12:27:20 | Fix http bench | diff --git a/benches/http.rs b/benches/http.rs
index 25b9eec..10c4194 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -66,7 +66,7 @@ fn is_not_space(c: u8) -> bool {
c != b' '
}
fn is_http_version(c: u8) -> bool {
- (b'0'..=b'9').contains(&c)
+ (b'0'..=b'9').contains(&c) || c == b'.'
}
fn end_of_... | 1 | 1 | 1 |
da6fcc241b15512d53bf3651574497b28dd455f6 | Arsenii Lyashenko | 2021-08-15T12:19:58 | Revert `From` to `Into` to support Rust 1.40 | diff --git a/src/error.rs b/src/error.rs
index 74713e3..23326c7 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1032,9 +1032,10 @@ impl<O, E> ParseResult<O, E> {
}
}
-impl<T, E> From<ParseResult<T, E>> for Result<Commit<T>, Commit<Tracked<E>>> {
- fn from(res: ParseResult<T, E>) -> Self {
- match res... | 1 | 7 | 6 |
135ea1c1d56dd1077a7dd89f47d907915b444922 | Arsenii Lyashenko | 2021-08-15T11:21:21 | Fix `buf_reader` test | diff --git a/src/stream/buf_reader.rs b/src/stream/buf_reader.rs
index ab4307c..60685ba 100644
--- a/src/stream/buf_reader.rs
+++ b/src/stream/buf_reader.rs
@@ -904,23 +904,24 @@ mod tests_sync {
use std::io::Read;
#[test]
+ #[allow(clippy::unused_io_amount)]
fn buf_reader() {
let mut read ... | 1 | 5 | 4 |
c26b7a2cf65665bd6b3f008439217698e537f1be | Arsenii Lyashenko | 2021-08-15T10:40:29 | Fix rest clippy warnings | diff --git a/Cargo.toml b/Cargo.toml
index 4b56e2e..b4183c0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -74,10 +74,12 @@ required-features = ["tokio-02", "futures-util-03"]
[[bench]]
name = "json"
harness = false
+required-features = ["std"]
[[bench]]
name = "http"
harness = false
+required-features = ["alloc"]... | 13 | 66 | 55 |
504b6059174565d2f094ed7ab71ac11dac067e74 | Arsenii Lyashenko | 2021-08-15T10:39:11 | Fix feature gates and imports in `stream::easy` module | diff --git a/src/stream/easy.rs b/src/stream/easy.rs
index ea53f2b..f384340 100644
--- a/src/stream/easy.rs
+++ b/src/stream/easy.rs
@@ -81,15 +81,13 @@
//!
//! [`EasyParser::easy_parse`]: super::super::parser::EasyParser::easy_parse
-use core as std;
-
#[cfg(feature = "std")]
use std::error::Error as StdError;
... | 1 | 3 | 5 |
fc1e9aff51e98a1aa236b826ebb73bd7d0055f08 | Arsenii Lyashenko | 2021-08-15T10:38:33 | Fix unused import without std | diff --git a/src/parser/combinator.rs b/src/parser/combinator.rs
index eca1f88..bb06b89 100644
--- a/src/parser/combinator.rs
+++ b/src/parser/combinator.rs
@@ -6,7 +6,7 @@ use crate::{
ParseResult::{self, *},
ResultExt, StreamError, Tracked,
},
- lib::{any::Any, fmt, marker::PhantomData, mem,... | 1 | 4 | 1 |
089ab7eb4f33dde182e6a46956c299391ab0a2b4 | Arsenii Lyashenko | 2021-08-15T10:23:56 | Enable `alloc` feature when `std` feature is enabled | diff --git a/Cargo.toml b/Cargo.toml
index 87fb532..4b56e2e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -64,7 +64,7 @@ tokio-02 = ["pin-project", "std", "tokio-02-dep", "futures-util-03", "pin-projec
tokio-03 = ["pin-project", "std", "tokio-03-dep", "futures-util-03", "pin-project-lite"]
tokio = ["tokio-dep", "tokio-... | 1 | 1 | 1 |
5aab1e462cdc6626395363635159db38ee6e025d | Arsenii Lyashenko | 2021-08-15T10:03:12 | Run `parser::byte` tests only with std | diff --git a/src/parser/byte.rs b/src/parser/byte.rs
index d4a2d12..de4183d 100644
--- a/src/parser/byte.rs
+++ b/src/parser/byte.rs
@@ -641,7 +641,7 @@ pub mod num {
}
}
-#[cfg(test)]
+#[cfg(all(feature = "std", test))]
mod tests {
use crate::stream::{buffered, position, read}; | 1 | 1 | 1 |
20e795c4265fd3695078ea2a82aacb80ab4d01a0 | Arsenii Lyashenko | 2021-08-15T09:59:06 | Fix `Any` is not imported | diff --git a/src/parser/combinator.rs b/src/parser/combinator.rs
index f3f7e07..eca1f88 100644
--- a/src/parser/combinator.rs
+++ b/src/parser/combinator.rs
@@ -6,7 +6,7 @@ use crate::{
ParseResult::{self, *},
ResultExt, StreamError, Tracked,
},
- lib::{fmt, marker::PhantomData, mem, str},
+ ... | 1 | 4 | 4 |
5f07a1c60dc1bf373df3a9718e6d3d2a22bcb13f | Arsenii Lyashenko | 2021-08-15T09:55:37 | Make `Parser::boxed` usable with `alloc` crate | diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index 22ccc59..f71f270 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -849,7 +849,7 @@ pub trait Parser<Input: Stream> {
/// assert_eq!(result, Ok((('a', 'c'), "")));
/// # }
/// ```
- #[cfg(feature = "std")]
+ #[cfg(feature = "alloc")]
... | 1 | 1 | 1 |
a3e52462c782ed4fb10a3355327fd6bb9b8b1c51 | Arsenii Lyashenko | 2021-08-15T09:55:12 | Make some combinators usable with `alloc` crate | diff --git a/src/parser/combinator.rs b/src/parser/combinator.rs
index 30901f5..f3f7e07 100644
--- a/src/parser/combinator.rs
+++ b/src/parser/combinator.rs
@@ -13,7 +13,7 @@ use crate::{
};
#[cfg(feature = "alloc")]
-use alloc::{string::String, vec::Vec};
+use alloc::{boxed::Box, string::String, vec::Vec};
#[de... | 1 | 13 | 13 |
30109ffca364869fed8d4127b3e25e8ad994cbf9 | Arsenii Lyashenko | 2021-08-15T09:46:12 | Make `stream::buffered` module usable with `alloc` crate | diff --git a/src/stream/buffered.rs b/src/stream/buffered.rs
index 93f7b82..32caba2 100644
--- a/src/stream/buffered.rs
+++ b/src/stream/buffered.rs
@@ -1,4 +1,4 @@
-use std::collections::VecDeque;
+use alloc::collections::VecDeque;
use crate::{
error::StreamError,
diff --git a/src/stream/mod.rs b/src/stream/mo... | 2 | 2 | 2 |
a77674e47624064b1707533519e87f593014eb1f | Arsenii Lyashenko | 2021-08-15T09:44:12 | Make `stream::easy` module usable with `alloc` crate | diff --git a/src/lib.rs b/src/lib.rs
index 7dd715f..5b5e270 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -201,7 +201,7 @@ extern crate alloc;
#[doc(inline)]
pub use crate::error::{ParseError, ParseResult, StdParseResult};
-#[cfg(feature = "std")]
+#[cfg(feature = "alloc")]
#[doc(inline)]
pub use crate::parser::Eas... | 4 | 32 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.