File tree 3 files changed +615
-14
lines changed
3 files changed +615
-14
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ impl EnumVariant {
13
13
self . value . value . clone ( )
14
14
}
15
15
16
- #[ classmethod ]
17
- pub fn from_string ( cls : & PyType , value : & str ) -> EnumVariant {
16
+ #[ staticmethod ]
17
+ pub fn from_string ( value : & str ) -> EnumVariant {
18
18
Self {
19
19
value : TeoEnumVariant {
20
20
value : value. to_owned ( ) ,
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ impl ObjectId {
15
15
self . value . to_hex ( )
16
16
}
17
17
18
- #[ classmethod ]
19
- pub fn from_string ( cls : & PyType , string : & str ) -> PyResult < ObjectId > {
18
+ #[ staticmethod ]
19
+ pub fn from_string ( string : & str ) -> PyResult < ObjectId > {
20
20
match BsonObjectId :: parse_str ( & string) {
21
21
Ok ( value) => Ok ( Self { value } ) ,
22
22
Err ( _) => Err ( PyValueError :: new_err ( "string doesn't represent valid ObjectId" ) )
You can’t perform that action at this time.
0 commit comments