[ty] Reuse tuple length accessors for size hints (#27366)

## Summary

Reuse tuple length accessors for size hints.
This commit is contained in:
David Peter authored and GitHub committed 2026-07-31 01:21:17 -07:00
1 parent 81f97ec410
commit 0e24940bd1
1 file changed
+1 -4
+1 -4
View File
@@ -58,10 +58,7 @@ impl TupleLength {
/// Returns the minimum and maximum length of this tuple. (The maximum length will be `None`
/// for a tuple with a variable-length portion.)
pub(crate) fn size_hint(self) -> (usize, Option<usize>) {
match self {
TupleLength::Fixed(len) => (len, Some(len)),
TupleLength::Variable(prefix, suffix) => (prefix + suffix, None),
}
(self.minimum(), self.maximum())
}
/// Returns the minimum length of this tuple.