Skip to content

Commit

Permalink
clash_ffi: fixed ci clippy lint wrong
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaobo Liu <[email protected]>
  • Loading branch information
cppcoffee committed Jan 27, 2025
1 parent 0587fa8 commit 89c8ada
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions clash_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ pub extern "C" fn clash_start(
cwd: *const c_char,
multithread: c_int,
) -> *mut c_char {
if config.is_null() {
return CString::new("Error: config is null pointer")
.unwrap()
.into_raw();
}

if log.is_null() {
return CString::new("Error: log is null pointer")
.unwrap()
.into_raw();
}

if cwd.is_null() {
return CString::new("Error: cwd is null pointer")
.unwrap()
.into_raw();
}

let config_str = unsafe { CStr::from_ptr(config) }

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-apple-darwin-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-apple-darwin-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-apple-darwin

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / riscv64gc-unknown-linux-gnu

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-apple-darwin

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-unknown-linux-gnu-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-unknown-linux-gnu-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / armv7-unknown-linux-gnueabihf

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-unknown-linux-musl

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-unknown-linux-gnu

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / armv7-unknown-linux-gnueabi

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / armv7-unknown-linux-musleabihf

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-unknown-linux-musl

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / armv7-unknown-linux-gnueabi-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-linux-android

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / i686-unknown-linux-gnu-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / i686-unknown-linux-gnu

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-linux-android

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / i686-linux-android

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / armv7-linux-androideabi

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-unknown-linux-gnu

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-pc-windows-msvc-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / aarch64-pc-windows-msvc

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / i686-pc-windows-msvc

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / i686-pc-windows-msvc-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-pc-windows-msvc

this public function might dereference a raw pointer but is not marked `unsafe`

Check failure on line 32 in clash_ffi/src/lib.rs

View workflow job for this annotation

GitHub Actions / x86_64-pc-windows-msvc-static-crt

this public function might dereference a raw pointer but is not marked `unsafe`
.to_str()
.unwrap_or_default()
Expand Down

0 comments on commit 89c8ada

Please sign in to comment.