File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -606,6 +606,7 @@ impl char {
606606 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
607607 #[ rustc_const_stable( feature = "const_char_len_utf" , since = "1.52.0" ) ]
608608 #[ inline]
609+ #[ must_use]
609610 pub const fn len_utf8 ( self ) -> usize {
610611 len_utf8 ( self as u32 )
611612 }
@@ -637,6 +638,7 @@ impl char {
637638 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
638639 #[ rustc_const_stable( feature = "const_char_len_utf" , since = "1.52.0" ) ]
639640 #[ inline]
641+ #[ must_use]
640642 pub const fn len_utf16 ( self ) -> usize {
641643 len_utf16 ( self as u32 )
642644 }
@@ -1738,6 +1740,7 @@ impl EscapeDebugExtArgs {
17381740}
17391741
17401742#[ inline]
1743+ #[ must_use]
17411744const fn len_utf8 ( code : u32 ) -> usize {
17421745 match code {
17431746 ..MAX_ONE_B => 1 ,
@@ -1748,6 +1751,7 @@ const fn len_utf8(code: u32) -> usize {
17481751}
17491752
17501753#[ inline]
1754+ #[ must_use]
17511755const fn len_utf16 ( code : u32 ) -> usize {
17521756 if ( code & 0xFFFF ) == code { 1 } else { 2 }
17531757}
You can’t perform that action at this time.
0 commit comments