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

Enable rust-analyzer for cfg #138

Merged
merged 6 commits into from
Dec 12, 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
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.inlayHints.enabled": "on"
},
"rust-analyzer.cargo.cfgs": {
"web_sys_unstable_apis": ""
},
"rust-analyzer.checkOnSave": true,
"rust-analyzer.check.command": "clippy"
"rust-analyzer.check.command": "clippy",
"rust-analyzer.cargo.extraEnv": {
"RUSTFLAGS": "--cfg web_sys_unstable_apis"
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Both server and browser client are written in Rust.

> [!NOTE]
> draft-ietf-moq-transport-06 prototype is [here](https://github.com/nttcom/moq-wasm/tree/draft-06)

## Implementation

Supported version: draft-ietf-moq-transport-06
Expand Down Expand Up @@ -38,6 +41,7 @@ Supported version: draft-ietf-moq-transport-06
- [ ] Priorities
- [ ] Object Cache


## Modules

### moqt-core
Expand Down
2 changes: 1 addition & 1 deletion moqt-client-sample/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ features = [
]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(web_sys_unstable_apis)'] }
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(web_sys_unstable_apis)'] }
2 changes: 0 additions & 2 deletions moqt-client-sample/config.toml

This file was deleted.

17 changes: 2 additions & 15 deletions moqt-client-sample/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,22 +671,9 @@ impl MOQTClient {
}

#[wasm_bindgen(js_name = sendUnsubscribeMessage)]
pub async fn send_unsubscribe_message(
&self,
track_namespace: js_sys::Array,
track_name: String,
) -> Result<JsValue, JsValue> {
pub async fn send_unsubscribe_message(&self, subscribe_id: u64) -> Result<JsValue, JsValue> {
if let Some(writer) = &*self.control_stream_writer.borrow() {
let length = track_namespace.length();
let mut track_namespace_vec: Vec<String> = Vec::with_capacity(length as usize);
for i in 0..length {
let js_element = track_namespace.get(i);
let string_element = js_element
.as_string()
.ok_or_else(|| JsValue::from_str("Array contains a non-string element"))?;
track_namespace_vec.push(string_element);
}
let unsubscribe_message = Unsubscribe::new(track_namespace_vec, track_name);
let unsubscribe_message = Unsubscribe::new(subscribe_id);
let mut unsubscribe_message_buf = BytesMut::new();
unsubscribe_message.packetize(&mut unsubscribe_message_buf);

Expand Down
Loading