Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rust-toolchain and set MSRV to 1.79 #58

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "ffmpeg-sidecar"
version = "2.0.0"
edition = "2021"
rust-version = "1.79"
description = "Wrap a standalone FFmpeg binary in an intuitive Iterator interface."
authors = ["Nathan Babcock <[email protected]>"]
categories = ["multimedia"]
Expand Down Expand Up @@ -39,4 +40,4 @@ nix = { version = "0.29.0", optional = true, features = [

[dependencies]
anyhow = "1.0.79"
reqwest = { version = "0.12.8", optional = true, features = ["blocking"]}
reqwest = { version = "0.12.8", optional = true, features = ["blocking"] }
10 changes: 5 additions & 5 deletions examples/named_pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ fn main() -> anyhow::Result<()> {
use std::sync::mpsc;
use std::thread;

const VIDEO_PIPE_NAME: &'static str = pipe_name!("ffmpeg_video");
const AUDIO_PIPE_NAME: &'static str = pipe_name!("ffmpeg_audio");
const SUBTITLES_PIPE_NAME: &'static str = pipe_name!("ffmpeg_subtitles");
const VIDEO_PIPE_NAME: &str = pipe_name!("ffmpeg_video");
const AUDIO_PIPE_NAME: &str = pipe_name!("ffmpeg_audio");
const SUBTITLES_PIPE_NAME: &str = pipe_name!("ffmpeg_subtitles");

// Prepare an FFmpeg command with separate outputs for video, audio, and subtitles.
let mut command = FfmpegCommand::new();
Expand All @@ -31,7 +31,7 @@ fn main() -> anyhow::Result<()> {
.overwrite() // <- overwrite required on windows
// Generate test video
.format("lavfi")
.input(format!("testsrc=size=1920x1080:rate=60:duration=10"))
.input("testsrc=size=1920x1080:rate=60:duration=10")
// Generate test audio
.format("lavfi")
.input("sine=frequency=1000:duration=10")
Expand Down Expand Up @@ -127,7 +127,7 @@ fn main() -> anyhow::Result<()> {
Ok(())
});

return Ok((thread, ready_sender));
Ok((thread, ready_sender))
})
.collect::<Result<Vec<_>>>()?;

Expand Down
4 changes: 2 additions & 2 deletions examples/sockets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn main() -> Result<()> {
.overwrite() // <- overwrite required on windows
// Generate test video
.format("lavfi")
.input(format!("testsrc=size=1920x1080:rate=60:duration=10"))
.input("testsrc=size=1920x1080:rate=60:duration=10")
// Generate test audio
.format("lavfi")
.input("sine=frequency=1000:duration=10")
Expand Down Expand Up @@ -76,7 +76,7 @@ fn listen_for_connections(tcp_port: u32, exit_receiver: Receiver<()>) -> Result<

let mut handler_threads = Vec::new();
loop {
if let Ok(_) = exit_receiver.try_recv() {
if exit_receiver.try_recv().is_ok() {
break;
}
match listener.accept() {
Expand Down
9 changes: 9 additions & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# If you see this, run "rustup self update" to get rustup 1.23 or newer.

# NOTE: above comment is for older `rustup` (before TOML support was added),
# which will treat the first line as the toolchain name, and therefore show it
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".

[toolchain]
channel = "1.79" # Avoid specifying a patch version here; see https://github.com/emilk/eframe_template/issues/145
components = ["rustfmt", "clippy"]
2 changes: 1 addition & 1 deletion src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ impl FfmpegCommand {
.get_args()
.filter_map(|s| {
s.to_str().map(|s| {
if s.starts_with("-") {
if s.starts_with('-') {
format!("\\\n {s}")
} else {
s.to_owned()
Expand Down
Loading