Skip to content

Commit db5090c

Browse files
committed
method stubs
1 parent 63ddd31 commit db5090c

File tree

3 files changed

+615
-14
lines changed

3 files changed

+615
-14
lines changed

src/object/value/enum_variant.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ impl EnumVariant {
1313
self.value.value.clone()
1414
}
1515

16-
#[classmethod]
17-
pub fn from_string(cls: &PyType, value: &str) -> EnumVariant {
16+
#[staticmethod]
17+
pub fn from_string(value: &str) -> EnumVariant {
1818
Self {
1919
value: TeoEnumVariant {
2020
value: value.to_owned(),

src/object/value/object_id.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ impl ObjectId {
1515
self.value.to_hex()
1616
}
1717

18-
#[classmethod]
19-
pub fn from_string(cls: &PyType, string: &str) -> PyResult<ObjectId> {
18+
#[staticmethod]
19+
pub fn from_string(string: &str) -> PyResult<ObjectId> {
2020
match BsonObjectId::parse_str(&string) {
2121
Ok(value) => Ok(Self { value }),
2222
Err(_) => Err(PyValueError::new_err("string doesn't represent valid ObjectId"))

0 commit comments

Comments
 (0)