commit
5b5eb1983c
|
@ -493,6 +493,7 @@ def set_minimal_package_versions(session: nox.Session):
|
|||
"regex": "1.7.3",
|
||||
"proptest": "1.0.0",
|
||||
"chrono": "0.4.25",
|
||||
"byteorder": "1.4.3",
|
||||
}
|
||||
|
||||
# run cargo update first to ensure that everything is at highest
|
||||
|
|
|
@ -79,12 +79,13 @@ pub enum ElementType {
|
|||
|
||||
impl ElementType {
|
||||
/// Determines the `ElementType` from a Python `struct` module format string.
|
||||
///
|
||||
/// See <https://docs.python.org/3/library/struct.html#format-strings> for more information
|
||||
/// about struct format strings.
|
||||
pub fn from_format(format: &CStr) -> ElementType {
|
||||
match format.to_bytes() {
|
||||
[char] | [b'@', char] => native_element_type_from_type_char(*char),
|
||||
[modifier, char] if matches!(modifier, b'=' | b'<' | b'>' | b'!') => {
|
||||
standard_element_type_from_type_char(*char)
|
||||
}
|
||||
[size] | [b'@', size] => native_element_type_from_type_char(*size),
|
||||
[b'=' | b'<' | b'>' | b'!', size] => standard_element_type_from_type_char(*size),
|
||||
_ => ElementType::Unknown,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ fn test_compile_errors() {
|
|||
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
|
||||
t.compile_fail("tests/ui/missing_intopy.rs");
|
||||
// adding extra error conversion impls changes the output
|
||||
#[cfg(not(any(feature = "eyre", feature = "anyhow")))]
|
||||
#[cfg(all(target_os = "linux", not(any(feature = "eyre", feature = "anyhow"))))]
|
||||
t.compile_fail("tests/ui/invalid_result_conversion.rs");
|
||||
t.compile_fail("tests/ui/not_send.rs");
|
||||
t.compile_fail("tests/ui/not_send2.rs");
|
||||
|
|
Loading…
Reference in New Issue