File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -232,15 +232,15 @@ pub trait ToSanitizedCase {
232232impl ToSanitizedCase for str {
233233 fn to_sanitized_pascal_case ( & self ) -> Cow < str > {
234234 let s = Case :: Pascal . sanitize ( self ) ;
235- if s. as_bytes ( ) . get ( 0 ) . unwrap_or ( & 0 ) . is_ascii_digit ( ) {
235+ if s. as_bytes ( ) . first ( ) . unwrap_or ( & 0 ) . is_ascii_digit ( ) {
236236 Cow :: from ( format ! ( "_{}" , s) )
237237 } else {
238238 s
239239 }
240240 }
241241 fn to_sanitized_constant_case ( & self ) -> Cow < str > {
242242 let s = Case :: Constant . sanitize ( self ) ;
243- if s. as_bytes ( ) . get ( 0 ) . unwrap_or ( & 0 ) . is_ascii_digit ( ) {
243+ if s. as_bytes ( ) . first ( ) . unwrap_or ( & 0 ) . is_ascii_digit ( ) {
244244 Cow :: from ( format ! ( "_{}" , s) )
245245 } else {
246246 s
@@ -250,7 +250,7 @@ impl ToSanitizedCase for str {
250250 const INTERNALS : [ & str ; 4 ] = [ "set_bit" , "clear_bit" , "bit" , "bits" ] ;
251251
252252 let s = Case :: Snake . sanitize ( self ) ;
253- if s. as_bytes ( ) . get ( 0 ) . unwrap_or ( & 0 ) . is_ascii_digit ( ) {
253+ if s. as_bytes ( ) . first ( ) . unwrap_or ( & 0 ) . is_ascii_digit ( ) {
254254 format ! ( "_{}" , s) . into ( )
255255 } else if INTERNALS . contains ( & s. as_ref ( ) ) {
256256 s + "_"
You can’t perform that action at this time.
0 commit comments