Skip to content

Commit

Permalink
♻️ Rename group len getter
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurlm committed Oct 7, 2024
1 parent 29ed450 commit 41d600b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion quickfix-msg-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ fn generate_group_reader(output: &mut String, struct_name: &str, group: &Message
// Generate code.
output.push_str(&format!(
r#" #[inline(always)]
pub fn get_{fun_name_suffix}_count(&self) -> usize {{
pub fn {fun_name_suffix}_len(&self) -> usize {{
self.inner
.get_field({group_type}::FIELD_ID)
.and_then(|x| x.parse().ok())
Expand Down
10 changes: 5 additions & 5 deletions quickfix-msg40/tests/test_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,31 @@ fn test_build_list_status() -> Result<(), QuickFixError> {

// Add some groups and check again string content
// NB. We clearly see group content if final string + check sorter works correctly 😎.
assert_eq!(obj.get_no_orders_count(), 0);
assert_eq!(obj.no_orders_len(), 0);

obj.add_no_orders(list_status::NoOrders::try_new(
"Order:10000".to_string(),
100,
50,
18.5,
)?)?;
assert_eq!(obj.get_no_orders_count(), 1);
assert_eq!(obj.no_orders_len(), 1);

obj.add_no_orders(list_status::NoOrders::try_new(
"Order:10001".to_string(),
89,
75,
987.4,
)?)?;
assert_eq!(obj.get_no_orders_count(), 2);
assert_eq!(obj.no_orders_len(), 2);

obj.add_no_orders(list_status::NoOrders::try_new(
"Order:10018".to_string(),
5,
79,
5.6,
)?)?;
assert_eq!(obj.get_no_orders_count(), 3);
assert_eq!(obj.no_orders_len(), 3);

assert_eq!(
obj.to_fix_string(),
Expand Down Expand Up @@ -186,7 +186,7 @@ fn test_group_iterator() -> Result<(), QuickFixError> {
)?)?;

// Check we have inserted something
assert_eq!(obj.get_no_orders_count(), 3);
assert_eq!(obj.no_orders_len(), 3);

// Iterate over group

Expand Down

0 comments on commit 41d600b

Please sign in to comment.