@@ -142,7 +142,6 @@ impl Error {
142142 }
143143
144144 /// Returns the kind of this error.
145- #[ inline]
146145 pub fn kind ( & self ) -> ErrorKind < ' _ > {
147146 let data = self . data ( ) ;
148147 if self . is_str {
@@ -154,38 +153,31 @@ impl Error {
154153 }
155154
156155 /// Returns the raw data of this error.
157- #[ inline]
158156 pub fn data ( & self ) -> & [ u8 ] {
159157 unsafe { & * self . data }
160158 }
161159
162160 /// Returns `true` if this error is a human-readable string.
163- #[ inline]
164161 pub fn is_str ( & self ) -> bool {
165162 self . is_str
166163 }
167164
168- #[ inline]
169165 fn new_str ( data : & ' static str ) -> Self {
170166 Self :: _new ( true , false , data. as_bytes ( ) )
171167 }
172168
173- #[ inline]
174169 fn new_string ( data : String ) -> Self {
175170 Self :: _new ( true , true , Box :: into_raw ( data. into_boxed_str ( ) . into_boxed_bytes ( ) ) )
176171 }
177172
178- #[ inline]
179173 fn new_bytes ( data : & ' static [ u8 ] ) -> Self {
180174 Self :: _new ( false , false , data)
181175 }
182176
183- #[ inline]
184177 fn new_vec ( data : Vec < u8 > ) -> Self {
185178 Self :: _new ( false , true , Box :: into_raw ( data. into_boxed_slice ( ) ) )
186179 }
187180
188- #[ inline]
189181 fn _new ( is_str : bool , drop : bool , data : * const [ u8 ] ) -> Self {
190182 debug_assert ! ( !data. is_null( ) ) ;
191183 Self { is_str, drop, data }
@@ -249,7 +241,6 @@ impl From<Vec<u8>> for Error {
249241}
250242
251243impl From < Bytes > for Error {
252- #[ inline]
253244 fn from ( value : Bytes ) -> Self {
254245 Self :: new_vec ( value. into ( ) )
255246 }
0 commit comments