Skip to content

Commit cf22900

Browse files
clippy: Fix missing safety warnings, enable in CI. (#227)
1 parent 0260f56 commit cf22900

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
- name: Cargo build
6464
run: cargo build --workspace --features bundled
6565

66+
- name: Cargo clippy
67+
run: cargo clippy --workspace --features bundled -- -D warnings
68+
6669
- name: Cargo test
6770
run: cargo test --workspace --features bundled
6871
env:

harfbuzz/src/blob.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ impl<'a> Blob<'a> {
8787
}
8888

8989
/// Construct a `Blob` from a raw pointer. Takes ownership of the blob.
90+
///
91+
/// # Safety
92+
///
93+
/// The pointer must be valid and must not be used after this function is called.
9094
pub unsafe fn from_raw(raw: *mut sys::hb_blob_t) -> Self {
9195
Blob {
9296
raw,

harfbuzz/src/buffer.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ impl Buffer {
8383
}
8484

8585
/// Construct a `Buffer` from a raw pointer. Takes ownership of the buffer.
86+
///
87+
/// # Safety
88+
///
89+
/// The pointer must be valid and must not be used after this function is called.
8690
pub unsafe fn from_raw(raw: *mut sys::hb_buffer_t) -> Self {
8791
Buffer { raw }
8892
}

harfbuzz/src/language.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ impl Language {
3939
.unwrap()
4040
}
4141

42+
/// Construct a `Language` from a raw pointer.
43+
///
44+
/// # Safety
45+
///
46+
/// The pointer must be a valid pointer.
4247
pub unsafe fn from_raw(raw: sys::hb_language_t) -> Self {
4348
Language { raw }
4449
}

0 commit comments

Comments
 (0)