Improve "Video upload info not found" #3804
ci.yml
on: pull_request
Detect Changes
6s
Typecheck
1m 14s
Format (Biome)
7s
Format (Cargo)
9s
Lint (Biome)
11s
Matrix: Build Desktop
Annotations
9 errors and 10 warnings
|
Format (Cargo)
Process completed with exit code 1.
|
|
Clippy
Clippy had exited with the 101 exit code
|
|
struct import `S3UploadMeta` is private:
apps/desktop/src-tauri/src/lib.rs#L89
error[E0603]: struct import `S3UploadMeta` is private
--> apps/desktop/src-tauri/src/lib.rs:89:14
|
89 | use upload::{S3UploadMeta, create_or_get_video, upload_image, upload_video};
| ^^^^^^^^^^^^ private struct import
|
note: the struct import `S3UploadMeta` is defined here...
--> apps/desktop/src-tauri/src/upload.rs:13:34
|
13 | use cap_project::{RecordingMeta, S3UploadMeta, UploadMeta};
| ^^^^^^^^^^^^
note: ...and refers to the struct `S3UploadMeta` which is defined here
--> /Users/runner/work/Cap/Cap/crates/project/src/lib.rs:7:9
|
7 | pub use meta::*;
| ^^^^ you could import this directly
help: import `S3UploadMeta` directly
|
89 | use upload::{cap_project::meta::S3UploadMeta, create_or_get_video, upload_image, upload_video};
| +++++++++++++++++++
|
|
failed to resolve: use of undeclared type `AuthedApiError`:
apps/desktop/src-tauri/src/upload.rs#L244
error[E0433]: failed to resolve: use of undeclared type `AuthedApiError`
--> apps/desktop/src-tauri/src/upload.rs:244:28
|
244 | return Err(AuthedApiError::UpgradeRequired);
| ^^^^^^^^^^^^^^ use of undeclared type `AuthedApiError`
|
help: consider importing this enum through its public re-export
|
3 + use crate::AuthedApiError;
|
|
|
failed to resolve: use of undeclared type `AuthedApiError`:
apps/desktop/src-tauri/src/upload.rs#L209
error[E0433]: failed to resolve: use of undeclared type `AuthedApiError`
--> apps/desktop/src-tauri/src/upload.rs:209:16
|
209 | return Err(AuthedApiError::InvalidAuthentication); // TODO
| ^^^^^^^^^^^^^^ use of undeclared type `AuthedApiError`
|
help: consider importing this enum through its public re-export
|
3 + use crate::AuthedApiError;
|
|
|
cannot find type `AuthedApiError` in this scope:
apps/desktop/src-tauri/src/upload.rs#L208
error[E0412]: cannot find type `AuthedApiError` in this scope
--> apps/desktop/src-tauri/src/upload.rs:208:27
|
208 | ) -> Result<S3UploadMeta, AuthedApiError> {
| ^^^^^^^^^^^^^^ not found in this scope
|
help: consider importing this enum through its public re-export
|
3 + use crate::AuthedApiError;
|
|
|
cannot find type `AuthedApiError` in this scope:
apps/desktop/src-tauri/src/upload.rs#L66
error[E0412]: cannot find type `AuthedApiError` in this scope
--> apps/desktop/src-tauri/src/upload.rs:66:27
|
66 | ) -> Result<UploadedItem, AuthedApiError> {
| ^^^^^^^^^^^^^^ not found in this scope
|
help: consider importing this enum through its public re-export
|
3 + use crate::AuthedApiError;
|
|
|
Build Desktop (aarch64-apple-darwin, macos-latest)
Process completed with exit code 1.
|
|
Build Desktop (x86_64-pc-windows-msvc, windows-latest)
Process completed with exit code 1.
|
|
unused import: `channel::mpsc`:
crates/recording/src/studio_recording.rs#L17
warning: unused import: `channel::mpsc`
--> crates/recording/src/studio_recording.rs:17:27
|
17 | FutureExt, StreamExt, channel::mpsc, future::OptionFuture, stream::FuturesUnordered,
| ^^^^^^^^^^^^^
|
|
unused import: `AudioFrame`:
crates/recording/src/studio_recording.rs#L8
warning: unused import: `AudioFrame`
--> crates/recording/src/studio_recording.rs:8:9
|
8 | AudioFrame, DoneFut, FinishedOutputPipeline, OutputPipeline, PipelineDoneError,
| ^^^^^^^^^^
|
|
unused import: `camera::CameraFeedLock`:
crates/recording/src/instant_recording.rs#L4
warning: unused import: `camera::CameraFeedLock`
--> crates/recording/src/instant_recording.rs:4:13
|
4 | feeds::{camera::CameraFeedLock, microphone::MicrophoneFeedLock},
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
|
unneeded `return` statement:
crates/enc-ffmpeg/src/video/h264.rs#L191
warning: unneeded `return` statement
--> crates/enc-ffmpeg/src/video/h264.rs:191:13
|
191 | return;
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
190 - tracing::error!("Failed to send EOF to encoder: {:?}", e);
191 - return;
190 + tracing::error!("Failed to send EOF to encoder: {:?}", e);
|
|
|
manual implementation of an assign operation:
crates/enc-ffmpeg/src/audio/buffered_resampler.rs#L92
warning: manual implementation of an assign operation
--> crates/enc-ffmpeg/src/audio/buffered_resampler.rs:92:13
|
92 | next_pts = next_pts + samples as i64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next_pts += samples as i64`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
= note: `#[warn(clippy::assign_op_pattern)]` on by default
|
|
redundant pattern matching, consider using `is_some()`:
crates/enc-ffmpeg/src/audio/buffered_resampler.rs#L78
warning: redundant pattern matching, consider using `is_some()`
--> crates/enc-ffmpeg/src/audio/buffered_resampler.rs:78:19
|
78 | while let Some(_) = self.resampler.delay() {
| ----------^^^^^^^------------------------- help: try: `while self.resampler.delay().is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
|
|
this `if` statement can be collapsed:
crates/enc-ffmpeg/src/audio/buffered_resampler.rs#L59
warning: this `if` statement can be collapsed
--> crates/enc-ffmpeg/src/audio/buffered_resampler.rs:59:9
|
59 | / if let Some(min_next_pts) = self.min_next_pts {
60 | | if let Some(pts) = frame.pts() {
61 | | frame.set_pts(Some(pts.max(min_next_pts)));
62 | | }
63 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
59 ~ if let Some(min_next_pts) = self.min_next_pts
60 ~ && let Some(pts) = frame.pts() {
61 | frame.set_pts(Some(pts.max(min_next_pts)));
62 ~ }
|
|
|
unneeded `return` statement:
crates/enc-ffmpeg/src/audio/buffered_resampler.rs#L51
warning: unneeded `return` statement
--> crates/enc-ffmpeg/src/audio/buffered_resampler.rs:51:9
|
51 | return remaining_samples;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
51 - return remaining_samples;
51 + remaining_samples
|
|
|
field `config` is never read:
crates/enc-ffmpeg/src/video/h264.rs#L142
warning: field `config` is never read
--> crates/enc-ffmpeg/src/video/h264.rs:142:5
|
139 | pub struct H264Encoder {
| ----------- field in this struct
...
142 | config: VideoInfo,
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
|
unused import: `tracing::trace`:
crates/scap-targets/src/platform/macos.rs#L23
warning: unused import: `tracing::trace`
--> crates/scap-targets/src/platform/macos.rs:23:5
|
23 | use tracing::trace;
| ^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|