Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all clippy lints #344

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

MarijnS95
Copy link
Contributor

metal-rs seems to have gotten quite behind on clippy lints, making new contributions tedious thanks to almost 100 warnings in the CI (and in a local IDE).

@MarijnS95 MarijnS95 force-pushed the clippy branch 2 times, most recently from 4682926 to 09beea7 Compare January 2, 2025 21:40
Comment on lines +93 to 95
/// # Safety
/// TODO
pub unsafe fn from_queue_handle(queue: dispatch_queue_t) -> Self {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle is a raw pointer, and probably needs to be valid.

Comment on lines 72 to 77
pub fn resolve_counter_range(&self, range: crate::NSRange) -> Vec<NSUInteger> {
let mut data = vec![0 as NSUInteger; range.length as usize];
let total_bytes = range.length * mem::size_of::<NSUInteger>() as u64;
let total_bytes = mem::size_of_val(data.as_slice()) as u64;
unsafe {
let ns_data: *mut crate::Object = msg_send![self, resolveCounterRange: range];
let () = msg_send![ns_data, getBytes: data.as_mut_ptr() length: total_bytes];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might actually be nice to use Vec::with_capacity() + spare_capacity_mut().

examples/texture/Cargo.toml Outdated Show resolved Hide resolved
@MarijnS95 MarijnS95 force-pushed the clippy branch 2 times, most recently from 65abc0f to 5a0ebc6 Compare January 3, 2025 10:29
@MarijnS95

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants