Skip to content

Commit 300118e

Browse files
committed
ndk: Add missing brackets to links to functions in doc-comments in ndk::midi
1 parent 802ab4a commit 300118e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

ndk/src/midi/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl MidiDevice {
158158

159159
/// Opens the input port so that the client can send data to it. Note that the returned
160160
/// [`MidiInputPort`] is intentionally `!Send` and `!Sync`; please use
161-
/// [`safe::SafeMidiDevice::open_safe_input_port`] if you need the thread-safe version.
161+
/// [`safe::SafeMidiDevice::open_safe_input_port()`] if you need the thread-safe version.
162162
pub fn open_input_port(&self, port_number: i32) -> Result<MidiInputPort<'_>> {
163163
unsafe {
164164
let input_port =
@@ -169,7 +169,7 @@ impl MidiDevice {
169169

170170
/// Opens the output port so that the client can receive data from it. Note that the returned
171171
/// [`MidiOutputPort`] is intentionally `!Send` and `!Sync`; please use
172-
/// [`safe::SafeMidiDevice::open_safe_output_port`] if you need the thread-safe version.
172+
/// [`safe::SafeMidiDevice::open_safe_output_port()`] if you need the thread-safe version.
173173
pub fn open_output_port(&self, port_number: i32) -> Result<MidiOutputPort<'_>> {
174174
unsafe {
175175
let output_port =
@@ -189,7 +189,7 @@ impl Drop for MidiDevice {
189189
}
190190

191191
/// A wrapper over [`ffi::AMidiInputPort`]. Note that [`MidiInputPort`] is intentionally `!Send` and
192-
/// `!Sync`; please use [`safe::SafeMidiDevice::open_safe_input_port`] if you need the thread-safe
192+
/// `!Sync`; please use [`safe::SafeMidiDevice::open_safe_input_port()`] if you need the thread-safe
193193
/// version.
194194
pub struct MidiInputPort<'a> {
195195
ptr: NonNull<ffi::AMidiInputPort>,
@@ -280,7 +280,7 @@ impl<'a> Drop for MidiInputPort<'a> {
280280
}
281281

282282
/// A wrapper over [`ffi::AMidiOutputPort`]. Note that [`MidiOutputPort`] is intentionally `!Send`
283-
/// and `!Sync`; please use [`safe::SafeMidiDevice::open_safe_output_port`] if you need the
283+
/// and `!Sync`; please use [`safe::SafeMidiDevice::open_safe_output_port()`] if you need the
284284
/// thread-safe version.
285285
pub struct MidiOutputPort<'a> {
286286
ptr: NonNull<ffi::AMidiOutputPort>,

ndk/src/midi/safe.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! Safe bindings for [`AMidiDevice`], [`AMidiInputPort`], and [`AMidiOutputPort`]
22
//!
33
//! Provides implementation of `SafeMidiDeviceBox` that ensures the current thread is attached to
4-
//! the Java VM when being dropped, which is required by [`AMidiDevice_release`]. All other types
5-
//! of this module holds an [`Arc`] of `SafeMidiDeviceBox`.
4+
//! the Java VM when being dropped, which is required by [`ffi::AMidiDevice_release()`]. All other
5+
//! types of this module holds an [`Arc`] of `SafeMidiDeviceBox`.
66
//!
7-
//! Note that all other functions except for [`AMidiDevice_fromJava`] and [`AMidiDevice_release`]
8-
//! are safe to be called in any thread without the calling thread attached to the Java VM.
7+
//! Note that all other functions except for [`ffi::AMidiDevice_fromJava()`] and
8+
//! [`ffi::AMidiDevice_release()`] are safe to be called in any thread without the calling thread
9+
//! attached to the Java VM.
910
//!
1011
//! [`AMidiDevice`]: https://developer.android.com/ndk/reference/group/midi#amididevice
11-
//! [`AMidiDevice_release`]: https://developer.android.com/ndk/reference/group/midi#amididevice_release
1212
//! [`AMidiInputPort`]: https://developer.android.com/ndk/reference/group/midi#amidiinputport
1313
//! [`AMidiOutputPort`]: https://developer.android.com/ndk/reference/group/midi#amidioutputport
1414
@@ -27,16 +27,16 @@ use super::*;
2727
/// [`MidiDevice`] is not dropped while the safe wrappers are alive.
2828
///
2929
/// [`SafeMidiDeviceBox`] also holds a pointer to the current Java VM to attach the calling thread
30-
/// of [`Drop::drop`] to the VM, which is required by [`ffi::AMidiDevice_release`].
30+
/// of [`SafeMidiDeviceBox::drop()`] to the VM, which is required by [`ffi::AMidiDevice_release()`].
3131
struct SafeMidiDeviceBox {
3232
midi_device: ManuallyDrop<MidiDevice>,
3333
java_vm: NonNull<jni_sys::JavaVM>,
3434
}
3535

36-
// SAFETY: [`SafeMidiDeviceBox::drop`] attaches the calling thread to the Java VM if required.
36+
// SAFETY: [`SafeMidiDeviceBox::drop()`] attaches the calling thread to the Java VM if required.
3737
unsafe impl Send for SafeMidiDeviceBox {}
3838

39-
// SAFETY: [`SafeMidiDeviceBox::drop`] attaches the calling thread to the Java VM if required.
39+
// SAFETY: [`SafeMidiDeviceBox::drop()`] attaches the calling thread to the Java VM if required.
4040
unsafe impl Sync for SafeMidiDeviceBox {}
4141

4242
impl Drop for SafeMidiDeviceBox {
@@ -239,6 +239,6 @@ impl Deref for SafeMidiOutputPort {
239239
unsafe impl Send for SafeMidiOutputPort {}
240240

241241
// SAFETY: AMidiOutputPort is guarded by a atomic state ([`AMIDI_Port::state`]), which enables
242-
// [`ffi::AMidiOutputPort_receive`] to detect accesses from multiple threads and return error.
242+
// [`ffi::AMidiOutputPort_receive()`] to detect accesses from multiple threads and return error.
243243
// https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/media/native/midi/amidi.cpp?q=symbol%3A%5CbMidiReceiver%3A%3Areceive%5Cb%20case%3Ayes
244244
unsafe impl Sync for SafeMidiOutputPort {}

0 commit comments

Comments
 (0)