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

Fix Rust docs build #1271

Merged
merged 4 commits into from
Dec 18, 2023
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
7 changes: 7 additions & 0 deletions .github/workflows/mediasoup-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ jobs:

- name: cargo test
run: cargo test --verbose

- name: cargo doc
run: cargo doc --locked --all --no-deps --lib
env:
DOCS_RS: '1'
RUSTDOCFLAGS: '-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links'

5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rust/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# NEXT

* Update h264-profile-level-id dependency to 0.2.0.
* Fix docs build (PR #1271).
* Rename `data_consumer::on_producer_resume` to `data_consumer::on_data_producer_resume` (PR #1271).

# 0.13.0

Expand Down
2 changes: 1 addition & 1 deletion rust/src/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl AppData {
}
}

/// Listening protocol, IP and port for [`WebRtcServer`] to listen on.
/// Listening protocol, IP and port for [`WebRtcServer`](crate::webrtc_server::WebRtcServer) to listen on.
///
/// # Notes on usage
/// If you use "0.0.0.0" or "::" as ip value, then you need to also provide `announced_ip`.
Expand Down
5 changes: 4 additions & 1 deletion rust/src/router/data_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,10 @@ impl DataConsumer {
}

/// Callback is called when the associated data producer is resumed.
pub fn on_producer_resume<F: Fn() + Send + Sync + 'static>(&self, callback: F) -> HandlerId {
pub fn on_data_producer_resume<F: Fn() + Send + Sync + 'static>(
&self,
callback: F,
) -> HandlerId {
self.inner()
.handlers
.data_producer_resume
Expand Down
10 changes: 5 additions & 5 deletions worker/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ use std::process::Command;
use std::{env, fs};

fn main() {
if env::var("DOCS_RS").is_ok() {
// Skip everything when building docs on docs.rs
return;
}

// On Windows Rust always links against release version of MSVC runtime, thus requires
// Release build here
let build_type = if cfg!(all(debug_assertions, not(windows))) {
Expand Down Expand Up @@ -45,6 +40,11 @@ fn main() {
)
.expect("Failed to write generated Rust flatbuffers into fbs.rs");

if env::var("DOCS_RS").is_ok() {
// Skip everything when building docs on docs.rs
return;
}

// Force forward slashes on Windows too so that is plays well with our tasks.py
let mediasoup_out_dir = format!("{}/out", out_dir.replace('\\', "/"));

Expand Down