1111use crate :: TagType ;
1212use core:: slice;
1313use core:: str;
14+ use core:: str:: Utf8Error ;
1415
1516const RSDPV1_LENGTH : usize = 20 ;
1617
@@ -31,8 +32,8 @@ impl RsdpV1Tag {
3132 /// The "RSD PTR " marker singature.
3233 ///
3334 /// This is originally a 8-byte C string (not null terminated!) that must contain "RSD PTR "
34- pub fn signature ( & self ) -> Option < & str > {
35- str:: from_utf8 ( & self . signature ) . ok ( )
35+ pub fn signature ( & self ) -> Result < & str , Utf8Error > {
36+ str:: from_utf8 ( & self . signature )
3637 }
3738
3839 /// Validation of the RSDPv1 checksum
@@ -46,8 +47,8 @@ impl RsdpV1Tag {
4647 }
4748
4849 /// An OEM-supplied string that identifies the OEM.
49- pub fn oem_id ( & self ) -> Option < & str > {
50- str:: from_utf8 ( & self . oem_id ) . ok ( )
50+ pub fn oem_id ( & self ) -> Result < & str , Utf8Error > {
51+ str:: from_utf8 ( & self . oem_id )
5152 }
5253
5354 /// The revision of the ACPI.
@@ -79,11 +80,11 @@ pub struct RsdpV2Tag {
7980}
8081
8182impl RsdpV2Tag {
82- /// The "RSD PTR " marker singature .
83+ /// The "RSD PTR " marker signature .
8384 ///
8485 /// This is originally a 8-byte C string (not null terminated!) that must contain "RSD PTR ".
85- pub fn signature ( & self ) -> Option < & str > {
86- str:: from_utf8 ( & self . signature ) . ok ( )
86+ pub fn signature ( & self ) -> Result < & str , Utf8Error > {
87+ str:: from_utf8 ( & self . signature )
8788 }
8889
8990 /// Validation of the RSDPv2 extended checksum
@@ -98,8 +99,8 @@ impl RsdpV2Tag {
9899 }
99100
100101 /// An OEM-supplied string that identifies the OEM.
101- pub fn oem_id ( & self ) -> Option < & str > {
102- str:: from_utf8 ( & self . oem_id ) . ok ( )
102+ pub fn oem_id ( & self ) -> Result < & str , Utf8Error > {
103+ str:: from_utf8 ( & self . oem_id )
103104 }
104105
105106 /// The revision of the ACPI.
0 commit comments