add explanation for size_hint

This commit is contained in:
Tom Dohrmann 2020-02-10 11:54:05 +01:00 committed by Ryan Leckey
parent 7185f1ff25
commit a2ba26dc7e

View File

@ -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
}
}
));