@@ -519,15 +519,16 @@ impl PayloadWriter {
519519    } 
520520} 
521521
522+ #[ allow( clippy:: doc_link_with_quotes) ]  
522523/// Iterator over all payloads written by a `PayloadWriter`. 
523524/// 
524- /// The source payload buffer is immediately drained of consumed data during the creation of this iterator (as  known as 
525+ /// The source payload buffer is immediately drained of consumed data during the creation of this iterator (also  known as 
525526/// ["pre-pooping our pants"][everyone_poops]). This ensures that the end state - the payload buffer contains only 
526527/// preserved bytes (like length prefixes) - is established immediately. 
527528/// 
528529/// [everyone_poops]: https://faultlore.com/blah/everyone-poops/ 
529530pub  struct  Payloads < ' a >  { 
530-     payloads_buf :  Vec < u8 > , 
531+     buf :  Vec < u8 > , 
531532    start :  usize , 
532533    offsets :  Drain < ' a ,  usize > , 
533534} 
@@ -539,7 +540,7 @@ impl<'a> Payloads<'a> {
539540        // for the next write operation. 
540541        let  drain_size = offsets. last ( ) . copied ( ) . unwrap_or ( 0 ) ; 
541542        Self  { 
542-             payloads_buf :  payload_buf. drain ( 0 ..drain_size) . collect ( ) , 
543+             buf :  payload_buf. drain ( 0 ..drain_size) . collect ( ) , 
543544            start :  0 , 
544545            offsets :  offsets. drain ( ..) , 
545546        } 
@@ -556,7 +557,7 @@ impl<'a> Payloads<'a> {
556557     pub  fn  next_payload ( & mut  self )  -> Option < & [ u8 ] >  { 
557558        let  offset = self . offsets . next ( ) ?; 
558559
559-         let  offset_buf = & self . payloads_buf [ self . start ..offset] ; 
560+         let  offset_buf = & self . buf [ self . start ..offset] ; 
560561        self . start  = offset; 
561562
562563        Some ( offset_buf) 
0 commit comments