-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
#94 incidentally enabled clippy on the pulse-rs subdirectory, revealing a large number of issues, as seen below.
https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364:
Checking pulse v0.3.0 (/home/runner/work/cubeb-pulse-rs/cubeb-pulse-rs/pulse-rs)
error: redundant field names in struct initialization
--> pulse-rs/src/error.rs:35:21
|
35 | ErrorCode { err: err }
| ^^^^^^^^ help: replace it with: `err`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `-D clippy::redundant-field-names` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::redundant_field_names)]`
error: mutable borrow from immutable input(s)
--> pulse-rs/src/context.rs:81:30
|
81 | pub fn raw_mut(&self) -> &mut ffi::pa_context {
| ^^^^^^^^^^^^^^^^^^^^
|
note: immutable borrow here
--> pulse-rs/src/context.rs:81:20
|
81 | pub fn raw_mut(&self) -> &mut ffi::pa_context {
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_from_ref
= note: `#[deny(clippy::mut_from_ref)]` on by default
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:117:85
|
117 | ffi::pa_context_set_state_callback(self.raw_mut(), Some(wrapped::<CB>), userdata);
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
= note: `#[deny(clippy::not_unsafe_ptr_arg_deref)]` on by default
error: this let-binding has unit value
--> pulse-rs/src/context.rs:110:13
|
110 | let result = (*cb.as_ptr())(&ctx, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `-D clippy::let-unit-value` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::let_unit_value)]`
help: omit the `let` binding
|
110 | (*cb.as_ptr())(&ctx, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
113 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:111:13
|
111 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:111:20
|
111 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
= note: `-D clippy::forget-non-drop` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::forget_non_drop)]`
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:144:17
|
144 | api,
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:177:72
|
177 | ffi::pa_context_drain(self.raw_mut(), Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:169:13
|
169 | let result = (*cb.as_ptr())(&ctx, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
169 | (*cb.as_ptr())(&ctx, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
172 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:170:13
|
170 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:170:20
|
170 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:210:88
|
210 | unsafe { ffi::pa_context_rttime_new(self.raw_mut(), usec, Some(wrapped::<CB>), userdata) }
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:204:13
|
204 | let result = (*cb.as_ptr())(&api, e, timeval, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
204 | (*cb.as_ptr())(&api, e, timeval, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
207 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:205:13
|
205 | forget(api);
| ^^^^^^^^^^^
|
note: argument has type `mainloop_api::MainloopApi`
--> pulse-rs/src/context.rs:205:20
|
205 | forget(api);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:238:82
|
238 | ffi::pa_context_get_server_info(self.raw_mut(), Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:230:13
|
230 | let result = (*cb.as_ptr())(&ctx, info, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
230 | (*cb.as_ptr())(&ctx, info, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
233 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:231:13
|
231 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:231:20
|
231 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:277:17
|
277 | userdata
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:265:13
|
265 | let result = (*cb.as_ptr())(&ctx, info, eol, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
265 | (*cb.as_ptr())(&ctx, info, eol, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
268 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:266:13
|
266 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:266:20
|
266 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:307:85
|
307 | ffi::pa_context_get_sink_info_list(self.raw_mut(), Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:299:13
|
299 | let result = (*cb.as_ptr())(&ctx, info, eol, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
299 | (*cb.as_ptr())(&ctx, info, eol, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
302 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:300:13
|
300 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:300:20
|
300 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:3[41](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:42):91
|
341 | ffi::pa_context_get_sink_input_info(self.raw_mut(), idx, Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:333:13
|
333 | let result = (*cb.as_ptr())(&ctx, info, eol, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
333 | (*cb.as_ptr())(&ctx, info, eol, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
336 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:334:13
|
334 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:334:20
|
334 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:370:87
|
370 | ffi::pa_context_get_source_info_list(self.raw_mut(), Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:362:13
|
362 | let result = (*cb.as_ptr())(&ctx, info, eol, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
362 | (*cb.as_ptr())(&ctx, info, eol, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
365 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:363:13
|
363 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:363:20
|
363 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:409:17
|
409 | userdata
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:396:13
|
396 | let result = (*cb.as_ptr())(&ctx, success, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
396 | (*cb.as_ptr())(&ctx, success, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
399 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:397:13
|
397 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:397:20
|
397 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:4[43](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:44):86
|
[44](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:45)3 | ffi::pa_context_subscribe(self.raw_mut(), m.into(), Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:435:13
|
435 | let result = (*cb.as_ptr())(&ctx, success, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
435 | (*cb.as_ptr())(&ctx, success, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
438 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:436:13
|
436 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:436:20
|
436 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/context.rs:479:89
|
479 | ffi::pa_context_set_subscribe_callback(self.raw_mut(), Some(wrapped::<CB>), userdata);
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/context.rs:472:13
|
472 | let result = (*cb.as_ptr())(&ctx, event, idx, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
472 | (*cb.as_ptr())(&ctx, event, idx, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
475 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/context.rs:473:13
|
473 | forget(ctx);
| ^^^^^^^^^^^
|
note: argument has type `context::Context`
--> pulse-rs/src/context.rs:473:20
|
473 | forget(ctx);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this let-binding has unit value
--> pulse-rs/src/mainloop_api.rs:24:9
|
24 | let result = mem::transmute::<_, &F>(&())(&api, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
24 | mem::transmute::<_, &F>(&())(&api, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
26 | ()
|
error: transmute used without annotations
--> pulse-rs/src/mainloop_api.rs:24:27
|
24 | let result = mem::transmute::<_, &F>(&())(&api, userdata);
| ^^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<&(), &F>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
= note: `-D clippy::missing-transmute-annotations` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::missing_transmute_annotations)]`
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/mainloop_api.rs:25:9
|
25 | mem::forget(api);
| ^^^^^^^^^^^^^^^^
|
note: argument has type `mainloop_api::MainloopApi`
--> pulse-rs/src/mainloop_api.rs:25:21
|
25 | mem::forget(api);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: mutable borrow from immutable input(s)
--> pulse-rs/src/mainloop_api.rs:35:30
|
35 | pub fn raw_mut(&self) -> &mut ffi::pa_mainloop_api {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: immutable borrow here
--> pulse-rs/src/mainloop_api.rs:35:20
|
35 | pub fn raw_mut(&self) -> &mut ffi::pa_mainloop_api {
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_from_ref
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/mainloop_api.rs:[45](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:46):64
|
45 | ffi::pa_mainloop_api_once(self.raw_mut(), wrapped, userdata);
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/mainloop_api.rs:52:19
|
52 | f(e);
| ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: unsafe function's docs are missing a `# Safety` section
--> pulse-rs/src/operation.rs:12:5
|
12 | pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_operation) -> Operation {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
= note: `-D clippy::missing-safety-doc` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::missing_safety_doc)]`
error: unneeded `return` statement
--> pulse-rs/src/proplist.rs:31:5
|
31 | return Proplist(raw);
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
31 - return Proplist(raw);
31 + Proplist(raw)
|
error: mutable borrow from immutable input(s)
--> pulse-rs/src/stream.rs:45:30
|
45 | pub fn raw_mut(&self) -> &mut ffi::pa_stream {
| ^^^^^^^^^^^^^^^^^^^
|
note: immutable borrow here
--> pulse-rs/src/stream.rs:45:20
|
45 | pub fn raw_mut(&self) -> &mut ffi::pa_stream {
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_from_ref
error: the following explicit lifetimes could be elided: 'a
--> pulse-rs/src/stream.rs:74:28
|
74 | pub fn get_device_name<'a>(&'a self) -> Result<&'a CStr> {
| ^^ ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
|
74 - pub fn get_device_name<'a>(&'a self) -> Result<&'a CStr> {
74 + pub fn get_device_name(&self) -> Result<&CStr> {
|
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/stream.rs:165:50
|
165 | ffi::pa_stream_write(self.raw_mut(), data, nbytes, None, offset, seek.into())
| ^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: unsafe function's docs are missing a `# Safety` section
--> pulse-rs/src/stream.rs:170:5
|
170 | pub unsafe fn peek(&self, data: *mut *const c_void, length: *mut usize) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
error: usage of a legacy numeric constant
--> pulse-rs/src/stream.rs:182:17
|
182 | if r == ::std::usize::MAX {
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `-D clippy::legacy-numeric-constants` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::legacy_numeric_constants)]`
help: use the associated constant instead
|
182 | if r == usize::MAX {
| ~~~~~~~~~~
error: usage of a legacy numeric constant
--> pulse-rs/src/stream.rs:195:17
|
195 | if r == ::std::usize::MAX {
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
195 | if r == usize::MAX {
| ~~~~~~~~~~
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/stream.rs:229:84
|
229 | ffi::pa_stream_update_timing_info(self.raw_mut(), Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/stream.rs:222:13
|
222 | let result = (*cb.as_ptr())(&mut stm, success, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
222 | (*cb.as_ptr())(&mut stm, success, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
225 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/stream.rs:223:13
|
223 | forget(stm);
| ^^^^^^^^^^^
|
note: argument has type `stream::Stream`
--> pulse-rs/src/stream.rs:223:20
|
223 | forget(stm);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/stream.rs:268:84
|
268 | ffi::pa_stream_set_state_callback(self.raw_mut(), Some(wrapped::<CB>), userdata);
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/stream.rs:261:13
|
261 | let result = (*cb.as_ptr())(&mut stm, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
261 | (*cb.as_ptr())(&mut stm, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
264 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/stream.rs:262:13
|
262 | forget(stm);
| ^^^^^^^^^^^
|
note: argument has type `stream::Stream`
--> pulse-rs/src/stream.rs:262:20
|
262 | forget(stm);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/stream.rs:301:84
|
301 | ffi::pa_stream_set_write_callback(self.raw_mut(), Some(wrapped::<CB>), userdata);
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/stream.rs:294:13
|
294 | let result = (*cb.as_ptr())(&mut stm, nbytes, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
294 | (*cb.as_ptr())(&mut stm, nbytes, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
297 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/stream.rs:295:13
|
295 | forget(stm);
| ^^^^^^^^^^^
|
note: argument has type `stream::Stream`
--> pulse-rs/src/stream.rs:295:20
|
295 | forget(stm);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/stream.rs:334:83
|
334 | ffi::pa_stream_set_read_callback(self.raw_mut(), Some(wrapped::<CB>), userdata);
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/stream.rs:327:13
|
327 | let result = (*cb.as_ptr())(&mut stm, nbytes, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
327 | (*cb.as_ptr())(&mut stm, nbytes, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
330 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/stream.rs:328:13
|
328 | forget(stm);
| ^^^^^^^^^^^
|
note: argument has type `stream::Stream`
--> pulse-rs/src/stream.rs:328:20
|
328 | forget(stm);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/stream.rs:360:86
|
360 | let r = unsafe { ffi::pa_stream_cork(self.raw_mut(), b, Some(wrapped::<CB>), userdata) };
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/stream.rs:354:13
|
354 | let result = (*cb.as_ptr())(&mut stm, success, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
354 | (*cb.as_ptr())(&mut stm, success, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
357 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/stream.rs:355:13
|
355 | forget(stm);
| ^^^^^^^^^^^
|
note: argument has type `stream::Stream`
--> pulse-rs/src/stream.rs:355:20
|
355 | forget(stm);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: this public function might dereference a raw pointer but is not marked `unsafe`
--> pulse-rs/src/stream.rs:439:89
|
439 | ffi::pa_stream_set_name(self.raw_mut(), name.as_ptr(), Some(wrapped::<CB>), userdata)
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
error: this let-binding has unit value
--> pulse-rs/src/stream.rs:432:13
|
432 | let result = (*cb.as_ptr())(&mut stm, success, userdata);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
432 | (*cb.as_ptr())(&mut stm, success, userdata);
|
help: variable `result` of type `()` can be replaced with explicit `()`
|
435 | ()
|
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> pulse-rs/src/stream.rs:433:13
|
433 | forget(stm);
| ^^^^^^^^^^^
|
note: argument has type `stream::Stream`
--> pulse-rs/src/stream.rs:433:20
|
433 | forget(stm);
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
error: unsafe function's docs are missing a `# Safety` section
--> pulse-rs/src/threaded_mainloop.rs:16:5
|
16 | pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_threaded_mainloop) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
error: mutable borrow from immutable input(s)
--> pulse-rs/src/threaded_mainloop.rs:24:30
|
24 | pub fn raw_mut(&self) -> &mut ffi::pa_threaded_mainloop {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: immutable borrow here
--> pulse-rs/src/threaded_mainloop.rs:24:20
|
24 | pub fn raw_mut(&self) -> &mut ffi::pa_threaded_mainloop {
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_from_ref
error: `0 as *const _` detected
--> pulse-rs/src/util.rs:19:51
|
19 | self.into().map(|o| o.as_ptr()).unwrap_or(0 as *const _)
| ^^^^^^^^^^^^^ help: try: `std::ptr::null()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_ptr
= note: `-D clippy::zero-ptr` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::zero_ptr)]`
error: this `impl` can be derived
--> pulse-rs/src/lib.rs:60:1
|
60 | / impl Default for SampleFormat {
61 | | fn default() -> Self {
62 | | SampleFormat::Invalid
63 | | }
64 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `-D clippy::derivable-impls` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::derivable_impls)]`
= help: remove the manual implementation...
help: ...and instead derive it...
|
43 + #[derive(Default)]
44 | pub enum SampleFormat {
|
help: ...and mark the default variant
|
44 ~ #[default]
45 ~ Invalid = ffi::PA_SAMPLE_INVALID,
|
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:66:1
|
66 | impl Into<ffi::pa_sample_format_t> for SampleFormat {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `-D clippy::from-over-into` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::from_over_into)]`
help: replace the `Into` implementation with `From<SampleFormat>`
|
66 ~ impl From<SampleFormat> for ffi::pa_sample_format_t {
67 ~ fn from(val: SampleFormat) -> Self {
68 ~ val as ffi::pa_sample_format_t
|
error: match expression looks like `matches!` macro
--> pulse-rs/src/lib.rs:88:9
|
88 | / match self {
89 | | ContextState::Connecting
90 | | | ContextState::Authorizing
91 | | | ContextState::SettingName
92 | | | ContextState::Ready => true,
93 | | _ => false,
94 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `-D clippy::match-like-matches-macro` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::match_like_matches_macro)]`
help: try
|
88 ~ matches!(self, ContextState::Connecting
89 + | ContextState::Authorizing
90 + | ContextState::SettingName
91 + | ContextState::Ready)
|
error: manual `RangeInclusive::contains` implementation
--> pulse-rs/src/lib.rs:98:12
|
98 | if x >= ffi::PA_CONTEXT_UNCONNECTED && x <= ffi::PA_CONTEXT_TERMINATED {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_CONTEXT_UNCONNECTED..=ffi::PA_CONTEXT_TERMINATED).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
= note: `-D clippy::manual-range-contains` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_range_contains)]`
error: transmute used without annotations
--> pulse-rs/src/lib.rs:99:39
|
99 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, ContextState>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: this `impl` can be derived
--> pulse-rs/src/lib.rs:106:1
|
106 | / impl Default for ContextState {
107 | | fn default() -> Self {
108 | | ContextState::Unconnected
109 | | }
110 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= help: remove the manual implementation...
help: ...and instead derive it...
|
74 + #[derive(Default)]
75 | pub enum ContextState {
|
help: ...and mark the default variant
|
75 ~ #[default]
76 ~ Unconnected = ffi::PA_CONTEXT_UNCONNECTED,
|
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:112:1
|
112 | impl Into<ffi::pa_context_state_t> for ContextState {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<ContextState>`
|
112 ~ impl From<ContextState> for ffi::pa_context_state_t {
113 ~ fn from(val: ContextState) -> Self {
114 ~ val as ffi::pa_context_state_t
|
error: match expression looks like `matches!` macro
--> pulse-rs/src/lib.rs:132:9
|
132 | / match self {
133 | | StreamState::Creating | StreamState::Ready => true,
134 | | _ => false,
135 | | }
| |_________^ help: try: `matches!(self, StreamState::Creating | StreamState::Ready)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
error: manual `RangeInclusive::contains` implementation
--> pulse-rs/src/lib.rs:139:12
|
139 | if x >= ffi::PA_STREAM_UNCONNECTED && x <= ffi::PA_STREAM_TERMINATED {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_STREAM_UNCONNECTED..=ffi::PA_STREAM_TERMINATED).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
error: transmute used without annotations
--> pulse-rs/src/lib.rs:140:39
|
140 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, StreamState>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: this `impl` can be derived
--> pulse-rs/src/lib.rs:1[47](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:48):1
|
147 | / impl Default for StreamState {
1[48](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:49) | | fn default() -> Self {
149 | | StreamState::Unconnected
150 | | }
151 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= help: remove the manual implementation...
help: ...and instead derive it...
|
120 + #[derive(Default)]
121 | pub enum StreamState {
|
help: ...and mark the default variant
|
121 ~ #[default]
122 ~ Unconnected = ffi::PA_STREAM_UNCONNECTED,
|
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:153:1
|
153 | impl Into<ffi::pa_stream_state_t> for StreamState {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<StreamState>`
|
153 ~ impl From<StreamState> for ffi::pa_stream_state_t {
154 ~ fn from(val: StreamState) -> Self {
155 ~ val as ffi::pa_stream_state_t
|
error: manual `RangeInclusive::contains` implementation
--> pulse-rs/src/lib.rs:169:12
|
169 | if x >= ffi::PA_OPERATION_RUNNING && x <= ffi::PA_OPERATION_CANCELLED {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_OPERATION_RUNNING..=ffi::PA_OPERATION_CANCELLED).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
error: transmute used without annotations
--> pulse-rs/src/lib.rs:170:39
|
170 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, OperationState>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:177:1
|
177 | impl Into<ffi::pa_operation_state_t> for OperationState {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<OperationState>`
|
177 ~ impl From<OperationState> for ffi::pa_operation_state_t {
178 ~ fn from(val: OperationState) -> Self {
179 ~ val as ffi::pa_operation_state_t
|
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:190:1
|
190 | impl Into<ffi::pa_context_flags_t> for ContextFlags {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<ContextFlags>`
|
190 ~ impl From<ContextFlags> for ffi::pa_context_flags_t {
191 ~ fn from(val: ContextFlags) -> Self {
192 ~ val.bits() as ffi::pa_context_flags_t
|
error: manual `RangeInclusive::contains` implementation
--> pulse-rs/src/lib.rs:205:12
|
205 | if x >= ffi::PA_DEVICE_TYPE_SINK && x <= ffi::PA_DEVICE_TYPE_SOURCE {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_DEVICE_TYPE_SINK..=ffi::PA_DEVICE_TYPE_SOURCE).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
error: transmute used without annotations
--> pulse-rs/src/lib.rs:206:39
|
206 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, DeviceType>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:213:1
|
213 | impl Into<ffi::pa_device_type_t> for DeviceType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<DeviceType>`
|
213 ~ impl From<DeviceType> for ffi::pa_device_type_t {
214 ~ fn from(val: DeviceType) -> Self {
215 ~ val as ffi::pa_device_type_t
|
error: manual `RangeInclusive::contains` implementation
--> pulse-rs/src/lib.rs:230:12
|
230 | if x >= ffi::PA_STREAM_NODIRECTION && x <= ffi::PA_STREAM_UPLOAD {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_STREAM_NODIRECTION..=ffi::PA_STREAM_UPLOAD).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
error: transmute used without annotations
--> pulse-rs/src/lib.rs:231:39
|
231 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, StreamDirection>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:238:1
|
238 | impl Into<ffi::pa_stream_direction_t> for StreamDirection {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<StreamDirection>`
|
238 ~ impl From<StreamDirection> for ffi::pa_stream_direction_t {
239 ~ fn from(val: StreamDirection) -> Self {
240 ~ val as ffi::pa_stream_direction_t
|
error: transmute used without annotations
--> pulse-rs/src/lib.rs:294:39
|
294 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u32, StreamFlags>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:301:1
|
301 | impl Into<ffi::pa_stream_flags_t> for StreamFlags {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<StreamFlags>`
|
301 ~ impl From<StreamFlags> for ffi::pa_stream_flags_t {
302 ~ fn from(val: StreamFlags) -> Self {
303 ~ val.bits() as ffi::pa_stream_flags_t
|
error: transmute used without annotations
--> pulse-rs/src/lib.rs:330:39
|
330 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u32, SubscriptionMask>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:337:1
|
337 | impl Into<ffi::pa_subscription_mask_t> for SubscriptionMask {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<SubscriptionMask>`
|
337 ~ impl From<SubscriptionMask> for ffi::pa_subscription_mask_t {
338 ~ fn from(val: SubscriptionMask) -> Self {
339 ~ val.bits() as ffi::pa_subscription_mask_t
|
error: manual `RangeInclusive::contains` implementation
--> pulse-rs/src/lib.rs:400:12
|
400 | if x >= ffi::PA_SEEK_RELATIVE && x <= ffi::PA_SEEK_RELATIVE_END {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_SEEK_RELATIVE..=ffi::PA_SEEK_RELATIVE_END).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
error: transmute used without annotations
--> pulse-rs/src/lib.rs:401:39
|
401 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, SeekMode>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:408:1
|
408 | impl Into<ffi::pa_seek_mode_t> for SeekMode {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<SeekMode>`
|
408 ~ impl From<SeekMode> for ffi::pa_seek_mode_t {
409 ~ fn from(val: SeekMode) -> Self {
410 ~ val as ffi::pa_seek_mode_t
|
error: transmute used without annotations
--> pulse-rs/src/lib.rs:443:39
|
443 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u32, SinkFlags>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:474:1
|
474 | impl Into<ffi::pa_source_flags_t> for SourceFlags {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<SourceFlags>`
|
474 ~ impl From<SourceFlags> for ffi::pa_source_flags_t {
475 ~ fn from(val: SourceFlags) -> Self {
476 ~ val.bits() as ffi::pa_source_flags_t
|
error: manual `RangeInclusive::contains` implementation
--> pulse-rs/src/lib.rs:[50](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:51)1:12
|
501 | if x >= ffi::PA_PORT_AVAILABLE_UNKNOWN && x <= ffi::PA_PORT_AVAILABLE_YES {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_PORT_AVAILABLE_UNKNOWN..=ffi::PA_PORT_AVAILABLE_YES).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
error: transmute used without annotations
--> pulse-rs/src/lib.rs:502:39
|
502 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, PortAvailable>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:509:1
|
509 | impl Into<ffi::pa_port_available_t> for PortAvailable {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<PortAvailable>`
|
509 ~ impl From<PortAvailable> for ffi::pa_port_available_t {
[51](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:52)0 ~ fn from(val: PortAvailable) -> Self {
511 ~ val as ffi::pa_port_available_t
|
error: manual `Range::contains` implementation
--> pulse-rs/src/lib.rs:[57](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:58)4:12
|
574 | if x >= ffi::PA_CHANNEL_POSITION_INVALID && x < ffi::PA_CHANNEL_POSITION_MAX {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(ffi::PA_CHANNEL_POSITION_INVALID..ffi::PA_CHANNEL_POSITION_MAX).contains(&x)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
error: transmute used without annotations
--> pulse-rs/src/lib.rs:575:39
|
575 | Some(unsafe { ::std::mem::transmute(x) })
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i32, ChannelPosition>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
error: this `impl` can be derived
--> pulse-rs/src/lib.rs:[58](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:59)2:1
|
582 | / impl Default for ChannelPosition {
583 | | fn default() -> Self {
584 | | ChannelPosition::Invalid
585 | | }
586 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= help: remove the manual implementation...
help: ...and instead derive it...
|
517 + #[derive(Default)]
518 | pub enum ChannelPosition {
|
help: ...and mark the default variant
|
518 ~ #[default]
519 ~ Invalid = ffi::PA_CHANNEL_POSITION_INVALID,
|
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> pulse-rs/src/lib.rs:588:1
|
588 | impl Into<ffi::pa_channel_position_t> for ChannelPosition {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<ChannelPosition>`
|
588 ~ impl From<ChannelPosition> for ffi::pa_channel_position_t {
589 ~ fn from(val: ChannelPosition) -> Self {
[59](https://github.com/mozilla/cubeb-pulse-rs/actions/runs/11055493595/job/31171084364#step:6:60)0 ~ val as ffi::pa_channel_position_t
|
error: could not compile `pulse` (lib) due to 109 previous errors
warning: build failed, waiting for other jobs to finish...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels