rust/hg-core/src/lock.rs
changeset 49930 e98fd81bb151
parent 49632 29cf3167e459
child 51868 db7dbe6f7bb2
--- a/rust/hg-core/src/lock.rs	Mon Jan 09 19:14:14 2023 +0100
+++ b/rust/hg-core/src/lock.rs	Mon Jan 09 19:18:43 2023 +0100
@@ -107,7 +107,7 @@
 fn lock_should_be_broken(data: &Option<String>) -> bool {
     (|| -> Option<bool> {
         let (prefix, pid) = data.as_ref()?.split_once(':')?;
-        if prefix != &*LOCK_PREFIX {
+        if prefix != *LOCK_PREFIX {
             return Some(false);
         }
         let process_is_running;
@@ -144,6 +144,8 @@
 
         /// Same as https://github.com/python/cpython/blob/v3.10.0/Modules/socketmodule.c#L5414
         const BUFFER_SIZE: usize = 1024;
+        // This cast is *needed* for platforms with signed chars
+        #[allow(clippy::unnecessary_cast)]
         let mut buffer = [0 as libc::c_char; BUFFER_SIZE];
         let hostname_bytes = unsafe {
             let result = libc::gethostname(buffer.as_mut_ptr(), BUFFER_SIZE);