@@ -528,7 +528,7 @@ impl PyStr {
528
528
radd?. call ( ( zelf, ) , vm)
529
529
} else {
530
530
Err ( vm. new_type_error ( format ! (
531
- "can only concatenate str (not \ " {}\ " ) to str" ,
531
+ r# "can only concatenate str (not "{}") to str"# ,
532
532
other. class( ) . name( )
533
533
) ) )
534
534
}
@@ -570,6 +570,7 @@ impl PyStr {
570
570
hash => hash,
571
571
}
572
572
}
573
+
573
574
#[ cold]
574
575
fn _compute_hash ( & self , vm : & VirtualMachine ) -> hash:: PyHash {
575
576
let hash_val = vm. state . hash_secret . hash_bytes ( self . as_bytes ( ) ) ;
@@ -583,6 +584,7 @@ impl PyStr {
583
584
pub fn byte_len ( & self ) -> usize {
584
585
self . data . len ( )
585
586
}
587
+
586
588
#[ inline]
587
589
pub fn is_empty ( & self ) -> bool {
588
590
self . data . is_empty ( )
@@ -1439,6 +1441,7 @@ impl PyStr {
1439
1441
struct CharLenStr < ' a > ( & ' a str , usize ) ;
1440
1442
impl std:: ops:: Deref for CharLenStr < ' _ > {
1441
1443
type Target = str ;
1444
+
1442
1445
fn deref ( & self ) -> & Self :: Target {
1443
1446
self . 0
1444
1447
}
@@ -1852,6 +1855,7 @@ impl AnyStrWrapper<Wtf8> for PyStrRef {
1852
1855
fn as_ref ( & self ) -> Option < & Wtf8 > {
1853
1856
Some ( self . as_wtf8 ( ) )
1854
1857
}
1858
+
1855
1859
fn is_empty ( & self ) -> bool {
1856
1860
self . data . is_empty ( )
1857
1861
}
@@ -1861,6 +1865,7 @@ impl AnyStrWrapper<str> for PyStrRef {
1861
1865
fn as_ref ( & self ) -> Option < & str > {
1862
1866
self . data . as_str ( )
1863
1867
}
1868
+
1864
1869
fn is_empty ( & self ) -> bool {
1865
1870
self . data . is_empty ( )
1866
1871
}
@@ -1870,6 +1875,7 @@ impl AnyStrWrapper<AsciiStr> for PyStrRef {
1870
1875
fn as_ref ( & self ) -> Option < & AsciiStr > {
1871
1876
self . data . as_ascii ( )
1872
1877
}
1878
+
1873
1879
fn is_empty ( & self ) -> bool {
1874
1880
self . data . is_empty ( )
1875
1881
}
@@ -1893,9 +1899,11 @@ impl anystr::AnyChar for char {
1893
1899
fn is_lowercase ( self ) -> bool {
1894
1900
self . is_lowercase ( )
1895
1901
}
1902
+
1896
1903
fn is_uppercase ( self ) -> bool {
1897
1904
self . is_uppercase ( )
1898
1905
}
1906
+
1899
1907
fn bytes_len ( self ) -> usize {
1900
1908
self . len_utf8 ( )
1901
1909
}
@@ -2122,9 +2130,11 @@ impl anystr::AnyChar for ascii::AsciiChar {
2122
2130
fn is_lowercase ( self ) -> bool {
2123
2131
self . is_lowercase ( )
2124
2132
}
2133
+
2125
2134
fn is_uppercase ( self ) -> bool {
2126
2135
self . is_uppercase ( )
2127
2136
}
2137
+
2128
2138
fn bytes_len ( self ) -> usize {
2129
2139
1
2130
2140
}
0 commit comments