Skip to content

Commit 1c883c5

Browse files
Use intradoc links, suppress generated doc warnings. (#218)
* harfbuzz-sys: Suppress doc warnings from generated bindings. * docs: Update to intradoc link syntax.
1 parent a6b33af commit 1c883c5

File tree

3 files changed

+30
-48
lines changed

3 files changed

+30
-48
lines changed

harfbuzz-sys/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ extern "C" {
1717
#[allow(non_snake_case)]
1818
#[allow(non_upper_case_globals)]
1919
#[allow(clippy::unreadable_literal)]
20+
#[allow(rustdoc::bare_urls)]
21+
#[allow(rustdoc::broken_intra_doc_links)]
2022
mod bindings;
2123

2224
pub use crate::bindings::*;

harfbuzz/src/buffer.rs

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ use crate::{Direction, Language};
3939
///
4040
/// * Direction: The direction in which the output glyphs flow. This is
4141
/// typically left to right or right to left. This is controlled via
42-
/// the [`set_direction`] method on `Buffer`.
42+
/// the [`Buffer::set_direction()`] method.
4343
/// * Script: Script is crucial for choosing the proper shaping behaviour
4444
/// for scripts that require it (e.g. Arabic) and the which OpenType
4545
/// features defined in the font to be applied. This is controlled via
46-
/// the [`set_script`] method on `Buffer`.
46+
/// the [`Buffer::set_script()`] method.
4747
/// * Language: Languages are crucial for selecting which OpenType feature
4848
/// to apply to the buffer which can result in applying language-specific
4949
/// behaviour. Languages are orthogonal to the scripts, and though they
5050
/// are related, they are different concepts and should not be confused
51-
/// with each other. This is controlled via the [`set_language`] method
52-
/// on `Buffer`.
51+
/// with each other. This is controlled via the [`Buffer::set_language()`]
52+
/// method.
5353
///
5454
/// Additionally, Harfbuzz can attempt to infer the values for these
55-
/// properties using the [`guess_segment_properties`] method on `Buffer`:
55+
/// properties using the [`Buffer::guess_segment_properties()`] method:
5656
///
5757
/// ```
5858
/// # use harfbuzz::{Buffer, Direction, sys};
@@ -61,11 +61,6 @@ use crate::{Direction, Language};
6161
/// assert_eq!(b.get_direction(), Direction::RTL);
6262
/// assert_eq!(b.get_script(), sys::HB_SCRIPT_ARABIC);
6363
/// ```
64-
///
65-
/// [`set_direction`]: #method.set_direction
66-
/// [`set_script`]: #method.set_script
67-
/// [`set_language`]: #method.set_language
68-
/// [`guess_segment_properties`]: #method.guess_segment_properties
6964
pub struct Buffer {
7065
/// The underlying `hb_buffer_t` from the `harfbuzz-sys` crate.
7166
///
@@ -193,7 +188,7 @@ impl Buffer {
193188
/// that has a script other than `HB_SCRIPT_COMMON`,
194189
/// `HB_SCRIPT_INHERITED`, and `HB_SCRIPT_UNKNOWN`.
195190
///
196-
/// Next, if buffer direction is not set (ie. is `Direction::Invalid`),
191+
/// Next, if buffer direction is not set (ie. is [`Direction::Invalid`]),
197192
/// it will be set to the natural horizontal direction of the buffer
198193
/// script as returned by `hb_script_get_horizontal_direction()`.
199194
///
@@ -212,12 +207,12 @@ impl Buffer {
212207
///
213208
/// See also:
214209
///
215-
/// * [`get_direction`](#method.get_direction)
216-
/// * [`set_direction`](#method.set_direction)
217-
/// * [`get_script`](#method.get_script)
218-
/// * [`set_script`](#method.set_script)
219-
/// * [`get_language`](#method.get_language)
220-
/// * [`set_language`](#method.set_language)
210+
/// * [`Buffer::get_direction`]
211+
/// * [`Buffer::set_direction`]
212+
/// * [`Buffer::get_script`]
213+
/// * [`Buffer::set_script`]
214+
/// * [`Buffer::get_language`]
215+
/// * [`Buffer::set_language`]
221216
pub fn guess_segment_properties(&mut self) {
222217
unsafe { sys::hb_buffer_guess_segment_properties(self.raw) };
223218
}
@@ -234,8 +229,8 @@ impl Buffer {
234229
///
235230
/// See also:
236231
///
237-
/// * [`get_direction`](#method.get_direction)
238-
/// * [`guess_segment_properties`](#method.guess_segment_properties)
232+
/// * [`Buffer::get_direction()`]
233+
/// * [`Buffer::guess_segment_properties()`]
239234
pub fn set_direction(&mut self, direction: Direction) {
240235
unsafe { sys::hb_buffer_set_direction(self.raw, direction.into()) };
241236
}
@@ -244,7 +239,7 @@ impl Buffer {
244239
///
245240
/// See also:
246241
///
247-
/// * [`set_direction`](#method.set_direction)
242+
/// * [`Buffer::set_direction()`]
248243
pub fn get_direction(&self) -> Direction {
249244
(unsafe { sys::hb_buffer_get_direction(self.raw) }).into()
250245
}
@@ -257,8 +252,8 @@ impl Buffer {
257252
///
258253
/// See also:
259254
///
260-
/// * [`get_script`](#method.get_script)
261-
/// * [`guess_segment_properties`](#method.guess_segment_properties)
255+
/// * [`Buffer::get_script()`]
256+
/// * [`Buffer::guess_segment_properties()`]
262257
pub fn set_script(&mut self, script: sys::hb_script_t) {
263258
unsafe { sys::hb_buffer_set_script(self.raw, script) };
264259
}
@@ -267,7 +262,7 @@ impl Buffer {
267262
///
268263
/// See also:
269264
///
270-
/// * [`set_script`](#method.set_script)
265+
/// * [`Buffer::set_script()`]
271266
pub fn get_script(&self) -> sys::hb_script_t {
272267
unsafe { sys::hb_buffer_get_script(self.raw) }
273268
}
@@ -282,8 +277,8 @@ impl Buffer {
282277
///
283278
/// See also:
284279
///
285-
/// * [`get_language`](#method.get_language)
286-
/// * [`guess_segment_properties`](#method.guess_segment_properties)
280+
/// * [`Buffer::get_language()`]
281+
/// * [`Buffer::guess_segment_properties()`]
287282
pub fn set_language(&mut self, language: Language) {
288283
unsafe { sys::hb_buffer_set_language(self.raw, language.as_raw()) };
289284
}
@@ -292,7 +287,7 @@ impl Buffer {
292287
///
293288
/// See also:
294289
///
295-
/// * [`set_language`](#method.set_language)
290+
/// * [`Buffer::set_language()`]
296291
pub fn get_language(&self) -> Language {
297292
unsafe { Language::from_raw(sys::hb_buffer_get_language(self.raw)) }
298293
}

harfbuzz/src/direction.rs

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::sys;
1111

1212
/// Direction of text flow during layout.
1313
///
14-
/// This maps to the [`hb_direction_t`] from
15-
/// [`harfbuzz-sys`]. It can be converted to
14+
/// This maps to the [`hb_direction_t`](crate::sys::hb_direction_t) from
15+
/// [`harfbuzz-sys`](crate::sys). It can be converted to
1616
/// or from `hb_direction_t` using the [`From`]
1717
/// and [`Into`] traits:
1818
///
@@ -27,42 +27,27 @@ use crate::sys;
2727
/// let dir: Direction = sys::HB_DIRECTION_TTB.into();
2828
/// assert_eq!(dir, Direction::TTB);
2929
/// ```
30-
///
31-
/// [`hb_direction_t`]: ../harfbuzz_sys/type.hb_direction_t.html
32-
/// [`harfbuzz-sys`]: ../harfbuzz_sys/index.html
33-
/// [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html
34-
/// [`Into`]: https://doc.rust-lang.org/std/convert/trait.Into.html
3530
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
3631
pub enum Direction {
3732
/// Initial, unset direction.
3833
///
39-
/// This corresponds to [`HB_DIRECTION_INVALID`].
40-
///
41-
/// [`HB_DIRECTION_INVALID`]: ../harfbuzz_sys/constant.HB_DIRECTION_INVALID.html
34+
/// This corresponds to [`HB_DIRECTION_INVALID`](crate::sys::HB_DIRECTION_INVALID).
4235
Invalid,
4336
/// Text is set horizontally from left to right.
4437
///
45-
/// This corresponds to [`HB_DIRECTION_LTR`].
46-
///
47-
/// [`HB_DIRECTION_LTR`]: ../harfbuzz_sys/constant.HB_DIRECTION_LTR.html
38+
/// This corresponds to [`HB_DIRECTION_LTR`](crate::sys::HB_DIRECTION_LTR).
4839
LTR,
4940
/// Text is set horizontally from right to left.
5041
///
51-
/// This corresponds to [`HB_DIRECTION_RTL`].
52-
///
53-
/// [`HB_DIRECTION_RTL`]: ../harfbuzz_sys/constant.HB_DIRECTION_RTL.html
42+
/// This corresponds to [`HB_DIRECTION_RTL`](crate::sys::HB_DIRECTION_RTL).
5443
RTL,
5544
/// Text is set vertically from top to bottom.
5645
///
57-
/// This corresponds to [`HB_DIRECTION_TTB`].
58-
///
59-
/// [`HB_DIRECTION_TTB`]: ../harfbuzz_sys/constant.HB_DIRECTION_TTB.html
46+
/// This corresponds to [`HB_DIRECTION_TTB`](crate::sys::HB_DIRECTION_TTB).
6047
TTB,
6148
/// Text is set vertically from bottom to top.
6249
///
63-
/// This corresponds to [`HB_DIRECTION_BTT`].
64-
///
65-
/// [`HB_DIRECTION_BTT`]: ../harfbuzz_sys/constant.HB_DIRECTION_BTT.html
50+
/// This corresponds to [`HB_DIRECTION_BTT`](crate::sys::HB_DIRECTION_BTT).
6651
BTT,
6752
}
6853

0 commit comments

Comments
 (0)