Skip to content

Commit

Permalink
ci: run clippy also on nightly (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
knopp authored May 20, 2024
1 parent 9b1e2d6 commit 2310460
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/check_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ jobs:
- ubuntu-latest
- macOS-latest
- windows-latest
rust:
- stable
- nightly
steps:
- name: Install GTK
if: (matrix.os == 'ubuntu-latest')
run: sudo apt-get update && sudo apt-get install libgtk-3-dev
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 #v2.7.0
- run: rustup default stable
- run: rustup default ${{ matrix.rust }}
- run: rustup update
- name: Install clippy
run: rustup component add clippy
Expand Down
4 changes: 3 additions & 1 deletion super_native_extensions/rust/src/android/data_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ fn get_data_for_uri<'a>(
let data = value.coerce_to_data(StringFormat::Utf8).unwrap_or_default();
let res = env.new_byte_array(data.len() as i32).unwrap();
let data: &[u8] = &data;
env.set_byte_array_region(&res, 0, unsafe { std::mem::transmute(data) })?;
env.set_byte_array_region(&res, 0, unsafe {
std::mem::transmute::<&[u8], &[i8]>(data)
})?;
Ok(res.into())
}

Expand Down
2 changes: 1 addition & 1 deletion super_native_extensions/rust/src/darwin/macos/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub(super) fn class_builder_from_name(name: &str) -> ManuallyDrop<ClassBuilder>
let res = MyClassBuilder { _cls: class };
// bit dirty, unfortunately ClassBuilder doesn't let us create instance with custom
// class, and it's now worth replicating the entire functionality here
ManuallyDrop::new(unsafe { std::mem::transmute(res) })
ManuallyDrop::new(unsafe { std::mem::transmute::<MyClassBuilder, ClassBuilder>(res) })
}

enum _CGImage {}
Expand Down
2 changes: 2 additions & 0 deletions super_native_extensions/rust/src/win32/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,12 @@ impl DpiFunctions {
let user_32 = LoadLibraryA(s!("user32")).unwrap();
let shlib = LoadLibraryA(s!("Shcore.dll")).unwrap();
Self {
#[allow(clippy::missing_transmute_annotations)]
get_dpi_for_window: std::mem::transmute(GetProcAddress(
user_32,
s!("GetDpiForWindow"),
)),
#[allow(clippy::missing_transmute_annotations)]
get_dpi_for_monitor: std::mem::transmute(GetProcAddress(
shlib,
s!("GetDpiForMonitor"),
Expand Down

0 comments on commit 2310460

Please sign in to comment.