Skip to content

Commit

Permalink
Fix Rust docs build (#1271)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc authored Dec 18, 2023
1 parent f9c081c commit c5eb1b4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
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

0 comments on commit c5eb1b4

Please sign in to comment.