Skip to content

Commit aee2625

Browse files
committed
Clippy
1 parent a396085 commit aee2625

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/zend/globals.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,16 @@ impl<'a> SapiHeader {
225225
pub fn as_str(&'a self) -> &'a str {
226226
unsafe {
227227
let slice = slice::from_raw_parts(self.header as *const u8, self.header_len);
228-
str::from_utf8(slice).unwrap()
228+
str::from_utf8(slice).expect("Invalid header string")
229229
}
230230
}
231231

232232
pub fn name(&'a self) -> &'a str {
233-
self.as_str().split(":").next().unwrap_or("")
233+
self.as_str().split(':').next().unwrap_or("").trim()
234234
}
235235

236236
pub fn value(&'a self) -> Option<&'a str> {
237-
self.as_str().split(":").nth(1)
237+
self.as_str().split(':').nth(1).map(|s| s.trim())
238238
}
239239
}
240240

src/zend/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<'a, T: 'a> Iterator for ZendLinkedListIterator<'a, T> {
3333
if self.position.is_null() {
3434
return None;
3535
}
36-
let ptr = unsafe { (&mut *self.position).data.as_mut_ptr() };
36+
let ptr = unsafe { (*self.position).data.as_mut_ptr() };
3737
let value = unsafe { &*(ptr as *const T as *mut T) };
3838
unsafe {
3939
zend_llist_get_next_ex(

0 commit comments

Comments
 (0)