mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
add explanation for size_hint
This commit is contained in:
parent
7185f1ff25
commit
a2ba26dc7e
@ -182,7 +182,9 @@ fn expand_derive_encode_struct(
|
||||
#(#writes)*
|
||||
}
|
||||
fn size_hint(&self) -> usize {
|
||||
4 + #column_count * (4 + 4) + #(#sizes)+*
|
||||
4 // oid
|
||||
+ #column_count * (4 + 4) // oid (int) and length (int) for each column
|
||||
+ #(#sizes)+* // sum of the size hints for each column
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user