File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -550,15 +550,9 @@ impl PyBytes {
550550
551551#[ pyclass]
552552impl Py < PyBytes > {
553- /// Borrowed bytes of the payload.
554- #[ inline]
555- pub fn payload_bytes ( & self ) -> & [ u8 ] {
556- self . payload ( ) . as_bytes ( )
557- }
558-
559553 #[ inline]
560554 pub fn as_bytes ( & self ) -> & [ u8 ] {
561- self . payload_bytes ( )
555+ self . payload ( ) . as_bytes ( )
562556 }
563557
564558 #[ pymethod]
Original file line number Diff line number Diff line change @@ -629,20 +629,14 @@ impl PyStr {
629629}
630630
631631impl Py < PyStr > {
632- /// Borrowed text of the payload.
633- #[ inline]
634- pub fn payload_wtf8 ( & self ) -> & Wtf8 {
635- self . payload ( ) . as_wtf8 ( )
636- }
637-
638632 #[ inline]
639633 pub fn as_wtf8 ( & self ) -> & Wtf8 {
640- self . payload_wtf8 ( )
634+ self . payload ( ) . as_wtf8 ( )
641635 }
642636
643637 #[ inline]
644638 pub fn as_bytes ( & self ) -> & [ u8 ] {
645- self . payload_wtf8 ( ) . as_bytes ( )
639+ self . payload ( ) . as_bytes ( )
646640 }
647641
648642 #[ inline]
Original file line number Diff line number Diff line change @@ -386,33 +386,25 @@ impl PyTuple<PyObjectRef> {
386386 }
387387}
388388
389- impl < R > Py < PyTuple < R > > {
390- /// Element slice of the tuple payload.
391- #[ inline]
392- pub fn payload_slice ( & self ) -> & [ R ] {
393- PyTuple :: as_slice ( self )
394- }
395- }
396-
397389impl Py < PyTuple > {
398390 #[ inline]
399391 pub fn as_slice ( & self ) -> & [ PyObjectRef ] {
400- self . payload_slice ( )
392+ self . payload ( ) . as_slice ( )
401393 }
402394
403395 #[ inline]
404396 pub fn len ( & self ) -> usize {
405- self . payload_slice ( ) . len ( )
397+ self . as_slice ( ) . len ( )
406398 }
407399
408400 #[ inline]
409401 pub fn is_empty ( & self ) -> bool {
410- self . payload_slice ( ) . is_empty ( )
402+ self . as_slice ( ) . is_empty ( )
411403 }
412404
413405 #[ inline]
414406 pub fn iter ( & self ) -> core:: slice:: Iter < ' _ , PyObjectRef > {
415- self . payload_slice ( ) . iter ( )
407+ self . as_slice ( ) . iter ( )
416408 }
417409
418410 pub fn extract_tuple < ' a , T : FromPyTuple < ' a > > ( & ' a self , vm : & VirtualMachine ) -> PyResult < T > {
You can’t perform that action at this time.
0 commit comments