MCPcopy Index your code
hub / github.com/RustPython/RustPython / validate_nonempty_seq

Function validate_nonempty_seq

crates/vm/src/stdlib/_ast/validate.rs:72–82  ·  view source on GitHub ↗
(
    vm: &VirtualMachine,
    len: usize,
    what: &'static str,
    owner: &'static str,
)

Source from the content-addressed store, hash-verified

70}
71
72fn validate_nonempty_seq(
73 vm: &VirtualMachine,
74 len: usize,
75 what: &'static str,
76 owner: &'static str,
77) -> PyResult<()> {
78 if len == 0 {
79 return Err(vm.new_value_error(format!("empty {what} on {owner}")));
80 }
81 Ok(())
82}
83
84fn validate_assignlist(
85 vm: &VirtualMachine,

Callers 3

validate_assignlistFunction · 0.85
validate_bodyFunction · 0.85
validate_stmtFunction · 0.85

Calls 1

ErrClass · 0.50

Tested by

no test coverage detected