Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

more clippy lints (#438)

Brendan Allan0136d040773e
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml
index 648ccd9a5..ad90bc7af 100644
--- a/apps/desktop/src-tauri/Cargo.toml
+++ b/apps/desktop/src-tauri/Cargo.toml
@@ -5,6 +5,9 @@ description = "Beautiful screen recordings, owned by you."
authors = ["you"]
edition = "2021"
+[lints]
+workspace = true
+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
@@ -123,6 +126,3 @@ codegen-units = 1 # Compile crates one after another so the compiler can optimiz
lto = true # Enables link to optimizations
opt-level = "s" # Optimize for binary size
debug = true
-
-[lints]
-workspace = true
diff --git a/crates/editor/Cargo.toml b/crates/editor/Cargo.toml
index 483e8143e..54f5f4647 100644
--- a/crates/editor/Cargo.toml
+++ b/crates/editor/Cargo.toml
@@ -3,8 +3,10 @@ name = "cap-editor"
version = "0.1.0"
edition = "2021"
-[dependencies]
+[lints]
+workspace = true
+[dependencies]
cap-media = { path = "../media" }
cap-project = { path = "../project" }
cap-rendering = { path = "../rendering" }
diff --git a/crates/editor/src/editor_instance.rs b/crates/editor/src/editor_instance.rs
index b92b2e0e1..f802fb01b 100644
--- a/crates/editor/src/editor_instance.rs
+++ b/crates/editor/src/editor_instance.rs
@@ -35,18 +35,6 @@ pub struct EditorInstance {
}
impl EditorInstance {
- pub fn project_path(projects_path: &PathBuf, video_id: &str) -> PathBuf {
- projects_path.join(format!(
- "{}{}",
- video_id,
- if video_id.ends_with(".cap") {
- ""
- } else {
- ".cap"
- }
- ))
- }
-
pub async fn new(
project_path: PathBuf,
on_state_change: impl Fn(&EditorState) + Send + Sync + 'static,
diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml
index 3199e3e5e..31d68124d 100644
--- a/crates/media/Cargo.toml
+++ b/crates/media/Cargo.toml
@@ -5,6 +5,9 @@ description = "A modular multimedia processing library"
edition = "2021"
rust-version = "1.80"
+[lints]
+workspace = true
+
[features]
default = []
debug-logging = [] # Feature flag to control debug logging
diff --git a/crates/media/src/encoders/opus.rs b/crates/media/src/encoders/opus.rs
index 98df39820..644c07a5c 100644
--- a/crates/media/src/encoders/opus.rs
+++ b/crates/media/src/encoders/opus.rs
@@ -144,8 +144,6 @@ impl OpusEncoder {
output_stream.set_time_base(FFRational(1, output_config.rate()));
output_stream.set_parameters(&encoder);
- dbg!(tag, encoder.format());
-
Ok(Self {
tag,
buffer: VecDeque::new(),
diff --git a/crates/media/src/feeds/audio.rs b/crates/media/src/feeds/audio.rs
index 463e50f17..da3b5d3b7 100644
--- a/crates/media/src/feeds/audio.rs
+++ b/crates/media/src/feeds/audio.rs
@@ -212,7 +212,7 @@ impl AudioRenderer {
// this will only seek if there is a significant change in actual vs expected next sample
// (corresponding to a trim or split point). Currently this change is at least 0.2 seconds
// - not sure we offer that much precision in the editor even!
- let new_cursor = match dbg!(timeline.get_segment_time(dbg!(playhead))) {
+ let new_cursor = match timeline.get_segment_time(playhead) {
Some((segment_time, segment_i)) => AudioRendererCursor {
segment_index: segment_i,
samples: self.playhead_to_samples(segment_time),
diff --git a/crates/media/src/feeds/audio_input.rs b/crates/media/src/feeds/audio_input.rs
index e115d69c8..39a5f5ed9 100644
--- a/crates/media/src/feeds/audio_input.rs
+++ b/crates/media/src/feeds/audio_input.rs
@@ -295,7 +295,6 @@ fn start_capturing(
info!("New audio sender attached");
}
Err(flume::TryRecvError::Disconnected) => {
- dbg!(control.sender_count());
warn!("Control receiver is unreachable! Shutting down audio capture");
return;
}
diff --git a/crates/media/src/pipeline/audio_buffer.rs b/crates/media/src/pipeline/audio_buffer.rs
index a4bdae475..ad598b596 100644
--- a/crates/media/src/pipeline/audio_buffer.rs
+++ b/crates/media/src/pipeline/audio_buffer.rs
@@ -68,7 +68,6 @@ impl AudioBuffer {
return None;
}
- dbg!(self.frame_size, drain);
let actual_samples_per_channel = if drain {
(self.len() / self.config.channels).min(self.frame_size)
} else {
diff --git a/crates/media/src/sources/audio_mixer.rs b/crates/media/src/sources/audio_mixer.rs
index ac7e55fe2..b5051f53d 100644
--- a/crates/media/src/sources/audio_mixer.rs
+++ b/crates/media/src/sources/audio_mixer.rs
@@ -74,7 +74,7 @@ impl AudioMixer {
.add(
&ffmpeg::filter::find("abuffer").expect("Failed to find abuffer filter"),
&format!("src{i}"),
- &dbg!(args),
+ &args,
)
.unwrap()
})
diff --git a/crates/recording/Cargo.toml b/crates/recording/Cargo.toml
index f6f179867..5f5491214 100644
--- a/crates/recording/Cargo.toml
+++ b/crates/recording/Cargo.toml
@@ -3,6 +3,9 @@ name = "cap-recording"
version = "0.1.0"
edition = "2021"
+[lints]
+workspace = true
+
[dependencies]
cap-project = { path = "../project" }
cap-media = { path = "../media" }
@@ -38,6 +41,3 @@ windows = { workspace = true, features = [
"Win32_Graphics_Gdi",
"Win32_UI_WindowsAndMessaging",
] }
-
-[lints]
-workspace = true
diff --git a/crates/rendering/Cargo.toml b/crates/rendering/Cargo.toml
index ff5c1e729..203027dbe 100644
--- a/crates/rendering/Cargo.toml
+++ b/crates/rendering/Cargo.toml
@@ -3,6 +3,9 @@ name = "cap-rendering"
version = "0.1.0"
edition = "2021"
+[lints]
+workspace = true
+
[dependencies]
anyhow.workspace = true
bytemuck = { version = "1.7", features = ["derive"] }
diff --git a/crates/video-decode/Cargo.toml b/crates/video-decode/Cargo.toml
index 176d871a6..ed78ebe19 100644
--- a/crates/video-decode/Cargo.toml
+++ b/crates/video-decode/Cargo.toml
@@ -3,6 +3,9 @@ name = "cap-video-decode"
version = "0.1.0"
edition = "2021"
+[lints]
+workspace = true
+
[dependencies]
ffmpeg.workspace = true
ffmpeg-sys-next.workspace = true