Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/approx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE file in the project root for full license text.

use std::borrow::Cow;
use std::ffi::c_int;
use std::ffi::{c_char, c_int};
use std::hint::unreachable_unchecked;

use crate::{
Expand Down Expand Up @@ -372,7 +372,7 @@ impl Regex {
let result = unsafe {
tre::tre_reganexec(
compiled_reg_obj,
data.as_ptr().cast::<i8>(),
data.as_ptr().cast::<c_char>(),
data.len(),
&mut amatch,
*params.get(),
Expand Down
4 changes: 2 additions & 2 deletions src/err.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl BindingErrorCode {
/// Type of error: `Binding` (see [`BindingErrorCode`]), or `Tre`
///
/// See the TRE documentation for more information on valid error codes for `Tre`.
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum ErrorKind {
/// Binding-specific error
Binding(BindingErrorCode),
Expand All @@ -39,7 +39,7 @@ pub enum ErrorKind {
}

/// Error type returned in results
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RegexError {
/// Kind of error
pub kind: ErrorKind,
Expand Down
3 changes: 2 additions & 1 deletion src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE file in the project root for full license text.

use std::borrow::Cow;
use std::ffi::c_char;
use std::hint::unreachable_unchecked;

use crate::{err::{BindingErrorCode, ErrorKind, RegexError, Result}, flags::RegexecFlags, tre, Regex};
Expand Down Expand Up @@ -169,7 +170,7 @@ impl Regex {
let result = unsafe {
tre::tre_regnexec(
compiled_reg_obj,
data.as_ptr().cast::<i8>(),
data.as_ptr().cast::<c_char>(),
data.len(),
nmatches,
match_vec.as_mut_ptr(),
Expand Down