Repository navigation
Commit dabf964
committed
fix(desktop): silence non-Linux dead_code in linux_media
`PROD_ORIGIN`, `DEV_ORIGIN` and `is_trusted_media_origin` are reachable only
from the `cfg(target_os = "linux")` `enable_media_capture` and from the tests,
so in the lib target on macOS or Windows `clippy -- -D warnings` fails with
three dead_code errors. That breaks `just desktop-tauri-clippy`, and with it
the pre-push hook, for anyone developing on a Mac. Upstream's CI runs that lint
on Linux only and so never sees it: the file arrived byte-identical from
upstream in PR #7 (c9aa555) and has been failing locally ever since.
An `allow` and not a `cfg`: the items must stay compiled on every platform
because `mod tests` unit-tests the origin check everywhere, which is what the
doc comment on `is_trusted_media_origin` explicitly asks for. Gating them to
Linux would trade three lint errors for three broken tests.
Verified both halves on darwin: Tauri clippy is clean and the three
linux_media tests still pass.
One module-level attribute rather than three item-level ones, to keep this to a
single hunk at the top of the file. The fix belongs upstream in block/buzz.
Signed-off-by: adrienlacombe <[email protected]>1 parent 3ce7c8a commit dabf964
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
24 | 42 | | |
25 | 43 | | |
26 | 44 | | |
| |||
0 commit comments