petsoi@discuss.tchncs.de to Linux@lemmy.ml · edit-23 months agoRustDesk: I Found This Open-Source TeamViewer Alternative Impressive!news.itsfoss.comexternal-linkmessage-square100fedilinkarrow-up1261arrow-down151file-text
arrow-up1210arrow-down1external-linkRustDesk: I Found This Open-Source TeamViewer Alternative Impressive!news.itsfoss.competsoi@discuss.tchncs.de to Linux@lemmy.ml · edit-23 months agomessage-square100fedilinkfile-text
Please have a look at the warnings in the comments: https://discuss.tchncs.de/post/21632052/12893621 https://discuss.tchncs.de/post/21632052/12897257
minus-squarePsyhackological@lemmy.mllinkfedilinkarrow-up3·edit-23 months agoWth is that, that is the most anti-idiomatic code I have ever seen https://github.com/rustdesk/rustdesk/blob/master/src%2Fplatform%2Flinux.rs#L176 pub fn get_cursor() -> ResultType<Option<u64>> { let mut res = None; DISPLAY.with(|conn| { if let Ok(d) = conn.try_borrow_mut() { if !d.is_null() { unsafe { let img = XFixesGetCursorImage(*d); if !img.is_null() { res = Some((*img).cursor_serial as u64); XFree(img as _); } } } } }); Ok(res) } I’m not an expert but this seems wrong.
minus-squareangel@sopuli.xyzlinkfedilinkarrow-up2·3 months agoYep, I’m not a Rust expert either, but this is pretty cursed. The comments on this post have some more examples of bad rustdesk code: https://lobste.rs/s/njfvjb/rustdesk_with_tailscale_on_arch_linux
Wth is that, that is the most anti-idiomatic code I have ever seen
https://github.com/rustdesk/rustdesk/blob/master/src%2Fplatform%2Flinux.rs#L176
pub fn get_cursor() -> ResultType<Option<u64>> { let mut res = None; DISPLAY.with(|conn| { if let Ok(d) = conn.try_borrow_mut() { if !d.is_null() { unsafe { let img = XFixesGetCursorImage(*d); if !img.is_null() { res = Some((*img).cursor_serial as u64); XFree(img as _); } } } } }); Ok(res) }
I’m not an expert but this seems wrong.
Yep, I’m not a Rust expert either, but this is pretty cursed. The comments on this post have some more examples of bad rustdesk code: https://lobste.rs/s/njfvjb/rustdesk_with_tailscale_on_arch_linux