@@ -27,7 +27,7 @@ use crate::{
2727 } ,
2828} ;
2929use bstr:: ByteSlice ;
30- use once_cell :: sync:: Lazy ;
30+ use std :: sync:: LazyLock ;
3131use std:: { mem:: size_of, ops:: Deref } ;
3232
3333#[ pyclass( module = false , name = "bytes" ) ]
@@ -568,7 +568,7 @@ impl AsBuffer for PyBytes {
568568
569569impl AsMapping for PyBytes {
570570 fn as_mapping ( ) -> & ' static PyMappingMethods {
571- static AS_MAPPING : Lazy < PyMappingMethods > = Lazy :: new ( || PyMappingMethods {
571+ static AS_MAPPING : LazyLock < PyMappingMethods > = LazyLock :: new ( || PyMappingMethods {
572572 length : atomic_func ! ( |mapping, _vm| Ok ( PyBytes :: mapping_downcast( mapping) . len( ) ) ) ,
573573 subscript : atomic_func ! (
574574 |mapping, needle, vm| PyBytes :: mapping_downcast( mapping) . _getitem( needle, vm)
@@ -581,7 +581,7 @@ impl AsMapping for PyBytes {
581581
582582impl AsSequence for PyBytes {
583583 fn as_sequence ( ) -> & ' static PySequenceMethods {
584- static AS_SEQUENCE : Lazy < PySequenceMethods > = Lazy :: new ( || PySequenceMethods {
584+ static AS_SEQUENCE : LazyLock < PySequenceMethods > = LazyLock :: new ( || PySequenceMethods {
585585 length : atomic_func ! ( |seq, _vm| Ok ( PyBytes :: sequence_downcast( seq) . len( ) ) ) ,
586586 concat : atomic_func ! ( |seq, other, vm| {
587587 PyBytes :: sequence_downcast( seq)
0 commit comments