Clippy fixes
This commit is contained in:
@@ -22,13 +22,11 @@ impl PalSignal for Sys {
|
||||
|
||||
fn raise(sig: c_int) -> c_int {
|
||||
let tid = e(unsafe { syscall!(GETTID) }) as pid_t;
|
||||
let ret = if tid == !0 {
|
||||
if tid == !0 {
|
||||
-1
|
||||
} else {
|
||||
e(unsafe { syscall!(TKILL, tid, sig) }) as c_int
|
||||
};
|
||||
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn sigaction(sig: c_int, act: *const sigaction, oact: *mut sigaction) -> c_int {
|
||||
|
||||
+3
-3
@@ -103,7 +103,7 @@ impl Write for StringWriter {
|
||||
ptr::copy_nonoverlapping(buf.as_ptr(), self.0, copy_size);
|
||||
self.1 -= copy_size;
|
||||
|
||||
self.0 = self.0.offset(copy_size as isize);
|
||||
self.0 = self.0.add(copy_size);
|
||||
*self.0 = 0;
|
||||
}
|
||||
|
||||
@@ -136,8 +136,8 @@ impl Write for UnsafeStringWriter {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
unsafe {
|
||||
ptr::copy_nonoverlapping(buf.as_ptr(), self.0, buf.len());
|
||||
*self.0.offset(buf.len() as isize) = b'\0';
|
||||
self.0 = self.0.offset(buf.len() as isize);
|
||||
self.0 = self.0.add(buf.len());
|
||||
*self.0 = b'\0';
|
||||
}
|
||||
Ok(buf.len())
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ pub enum Line<'a> {
|
||||
impl RawLineBuffer {
|
||||
pub const fn new(fd: c_int) -> Self {
|
||||
Self {
|
||||
fd: fd,
|
||||
fd,
|
||||
buf: Vec::new(),
|
||||
newline: None,
|
||||
read: 0,
|
||||
|
||||
Reference in New Issue
Block a user