@@ -32,6 +32,8 @@ class RustType(object):
3232 STD_REF_MUT = "StdRefMut"
3333 STD_REF_CELL = "StdRefCell"
3434 STD_NONZERO_NUMBER = "StdNonZeroNumber"
35+ STD_PATH = "StdPath"
36+ STD_PATHBUF = "StdPathBuf"
3537
3638
3739STD_STRING_REGEX = re .compile (r"^(alloc::([a-z_]+::)+)String$" )
@@ -51,6 +53,22 @@ class RustType(object):
5153STD_REF_MUT_REGEX = re .compile (r"^(core::([a-z_]+::)+)RefMut<.+>$" )
5254STD_REF_CELL_REGEX = re .compile (r"^(core::([a-z_]+::)+)RefCell<.+>$" )
5355STD_NONZERO_NUMBER_REGEX = re .compile (r"^(core::([a-z_]+::)+)NonZero<.+>$" )
56+ STD_OS_STRING_REGEX = re .compile (r"^(std::ffi::(\w+::)+)OsString$" )
57+ STD_VEC_REGEX = re .compile (r"^(alloc::(\w+::)+)Vec<.+>$" )
58+ STD_VEC_DEQUE_REGEX = re .compile (r"^(alloc::(\w+::)+)VecDeque<.+>$" )
59+ STD_BTREE_SET_REGEX = re .compile (r"^(alloc::(\w+::)+)BTreeSet<.+>$" )
60+ STD_BTREE_MAP_REGEX = re .compile (r"^(alloc::(\w+::)+)BTreeMap<.+>$" )
61+ STD_HASH_MAP_REGEX = re .compile (r"^(std::collections::(\w+::)+)HashMap<.+>$" )
62+ STD_HASH_SET_REGEX = re .compile (r"^(std::collections::(\w+::)+)HashSet<.+>$" )
63+ STD_RC_REGEX = re .compile (r"^(alloc::(\w+::)+)Rc<.+>$" )
64+ STD_ARC_REGEX = re .compile (r"^(alloc::(\w+::)+)Arc<.+>$" )
65+ STD_CELL_REGEX = re .compile (r"^(core::(\w+::)+)Cell<.+>$" )
66+ STD_REF_REGEX = re .compile (r"^(core::(\w+::)+)Ref<.+>$" )
67+ STD_REF_MUT_REGEX = re .compile (r"^(core::(\w+::)+)RefMut<.+>$" )
68+ STD_REF_CELL_REGEX = re .compile (r"^(core::(\w+::)+)RefCell<.+>$" )
69+ STD_NONZERO_NUMBER_REGEX = re .compile (r"^core::num::([a-z_]+::)*NonZero.+$" )
70+ STD_PATHBUF_REGEX = re .compile (r"^std::path::PathBuf$" )
71+ STD_PATH_REGEX = re .compile (r"^&(mut )?std::path::Path$" )
5472
5573TUPLE_ITEM_REGEX = re .compile (r"__\d+$" )
5674
@@ -75,6 +93,8 @@ class RustType(object):
7593 RustType .STD_REF_CELL : STD_REF_CELL_REGEX ,
7694 RustType .STD_CELL : STD_CELL_REGEX ,
7795 RustType .STD_NONZERO_NUMBER : STD_NONZERO_NUMBER_REGEX ,
96+ RustType .STD_PATHBUF : STD_PATHBUF_REGEX ,
97+ RustType .STD_PATH : STD_PATH_REGEX ,
7898}
7999
80100def is_tuple_fields (fields ):
0 commit comments