mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Mark PyPattern, PyMatch as ThreadSafe
This commit is contained in:
1 parent
0cea276cb1
commit
cc2e97c436
1 file changed
+5
-1
+5
-1
@@ -13,7 +13,7 @@ use crate::function::{Args, OptionalArg};
|
||||
use crate::obj::objint::{PyInt, PyIntRef};
|
||||
use crate::obj::objstr::{PyString, PyStringRef};
|
||||
use crate::obj::objtype::PyClassRef;
|
||||
use crate::pyobject::{PyClassImpl, PyObjectRef, PyResult, PyValue, TryFromObject};
|
||||
use crate::pyobject::{PyClassImpl, PyObjectRef, PyResult, PyValue, ThreadSafe, TryFromObject};
|
||||
use crate::vm::VirtualMachine;
|
||||
|
||||
#[pyclass(name = "Pattern")]
|
||||
@@ -23,6 +23,8 @@ struct PyPattern {
|
||||
pattern: String,
|
||||
}
|
||||
|
||||
impl ThreadSafe for PyPattern {}
|
||||
|
||||
const IGNORECASE: usize = 2;
|
||||
const LOCALE: usize = 4;
|
||||
const MULTILINE: usize = 8;
|
||||
@@ -75,6 +77,8 @@ struct PyMatch {
|
||||
captures: Vec<Option<(usize, usize)>>,
|
||||
}
|
||||
|
||||
impl ThreadSafe for PyMatch {}
|
||||
|
||||
impl fmt::Debug for PyMatch {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Match()")
|
||||
|
||||
Reference in new issue
Block a user