Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Auto-format: cargo fmt --all
  • Loading branch information
github-actions[bot] committed Feb 3, 2026
commit 25ed4f82d72a4bb7ed6f02e17f6588f6d5341a26
9 changes: 3 additions & 6 deletions crates/vm/src/types/structseq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ pub trait PyStructSequence: StaticType + PyClassImpl + Sized + 'static {
)));
}

let n_fields = Self::Data::REQUIRED_FIELD_NAMES.len()
+ Self::Data::OPTIONAL_FIELD_NAMES.len();
let n_fields =
Self::Data::REQUIRED_FIELD_NAMES.len() + Self::Data::OPTIONAL_FIELD_NAMES.len();
let mut items: Vec<PyObjectRef> = zelf.as_slice()[..n_fields].to_vec();

let mut kwargs = args.kwargs.clone();
Expand All @@ -268,10 +268,7 @@ pub trait PyStructSequence: StaticType + PyClassImpl + Sized + 'static {
// Check for unexpected keyword arguments
if !kwargs.is_empty() {
let names: Vec<&str> = kwargs.keys().map(|k| k.as_str()).collect();
return Err(vm.new_type_error(format!(
"Got unexpected field name(s): {:?}",
names
)));
return Err(vm.new_type_error(format!("Got unexpected field name(s): {:?}", names)));
}

PyTuple::new_unchecked(items.into_boxed_slice())
Expand Down
Loading