Skip to content

Commit a940eeb

Browse files
committed
Fix intra-doc links
1 parent 0937c84 commit a940eeb

File tree

10 files changed

+38
-29
lines changed

10 files changed

+38
-29
lines changed

.github/workflows/_lints.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,17 @@ jobs:
6363
- uses: actions/checkout@v3
6464
- name: Install build dependencies
6565
run: sudo apt install libudev-dev
66+
# Use nightly Rust (as docs.rs does), because some of our dependencies enable the
67+
# `doc_cfg` feature when the `docsrs` config option is set.
68+
- uses: dtolnay/rust-toolchain@nightly
69+
id: toolchain
70+
- run: rustup override set ${{ steps.toolchain.outputs.name }}
6671
- run: cargo fetch
6772
# Requires #![deny(rustdoc::broken_intra_doc_links)] in crates.
6873
- name: Check intra-doc links
6974
run: cargo doc --workspace --document-private-items
75+
env:
76+
RUSTDOCFLAGS: --cfg docsrs
7077

7178
fmt:
7279
name: Rustfmt

crates/flipperzero/src/furi/string.rs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const WHITESPACE: &[char] = &[
4242
/// allocator. Very short strings (7 bytes or fewer) are stored directly inside the
4343
/// `FuriString` struct (which is stored on the heap), while longer strings are allocated
4444
/// on the heap by the Flipper Zero firmware.
45+
///
46+
/// [`CString`]: alloc::ffi::CString
47+
/// [`String`]: alloc::string::String
4548
#[derive(Eq)]
4649
pub struct FuriString(NonNull<sys::FuriString>);
4750

@@ -296,11 +299,10 @@ impl FuriString {
296299
///
297300
/// Returns `false` if it does not.
298301
///
299-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
302+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
300303
/// [`char`]s.
301304
///
302305
/// [`char`]: prim@char
303-
/// [pattern]: self::pattern
304306
#[inline]
305307
pub fn contains<P: Pattern>(&self, pat: P) -> bool {
306308
pat.is_contained_in(self)
@@ -310,11 +312,10 @@ impl FuriString {
310312
///
311313
/// Returns `false` if it does not.
312314
///
313-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
315+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
314316
/// [`char`]s.
315317
///
316318
/// [`char`]: prim@char
317-
/// [pattern]: self::pattern
318319
pub fn starts_with<P: Pattern>(&self, pat: P) -> bool {
319320
pat.is_prefix_of(self)
320321
}
@@ -323,11 +324,10 @@ impl FuriString {
323324
///
324325
/// Returns `false` if it does not.
325326
///
326-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
327+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
327328
/// [`char`]s.
328329
///
329330
/// [`char`]: prim@char
330-
/// [pattern]: self::pattern
331331
pub fn ends_with<P: Pattern>(&self, pat: P) -> bool {
332332
pat.is_suffix_of(self)
333333
}
@@ -336,11 +336,10 @@ impl FuriString {
336336
///
337337
/// Returns [`None`] if the pattern doesn't match.
338338
///
339-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
339+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
340340
/// [`char`]s.
341341
///
342342
/// [`char`]: prim@char
343-
/// [pattern]: self::pattern
344343
#[inline]
345344
pub fn find<P: Pattern>(&self, pat: P) -> Option<usize> {
346345
pat.find_in(self)
@@ -351,11 +350,10 @@ impl FuriString {
351350
///
352351
/// Returns [`None`] if the pattern doesn't match.
353352
///
354-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
353+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
355354
/// [`char`]s.
356355
///
357356
/// [`char`]: prim@char
358-
/// [pattern]: self::pattern
359357
#[inline]
360358
pub fn rfind<P: Pattern>(&self, pat: P) -> Option<usize> {
361359
pat.rfind_in(self)
@@ -404,23 +402,21 @@ impl FuriString {
404402

405403
/// Repeatedly removes from this string all prefixes and suffixes that match a pattern.
406404
///
407-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
405+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
408406
/// [`char`]s.
409407
///
410408
/// [`char`]: prim@char
411-
/// [pattern]: self::pattern
412409
pub fn trim_matches<P: Pattern + Copy>(&mut self, pat: P) {
413410
self.trim_start_matches(pat);
414411
self.trim_end_matches(pat);
415412
}
416413

417414
/// Repeatedly removes from this string all prefixes that match a pattern.
418415
///
419-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
416+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
420417
/// [`char`]s.
421418
///
422419
/// [`char`]: prim@char
423-
/// [pattern]: self::pattern
424420
///
425421
/// # Text directionality
426422
///
@@ -434,11 +430,10 @@ impl FuriString {
434430

435431
/// Repeatedly removes from this string all suffixes that match a pattern.
436432
///
437-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
433+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
438434
/// [`char`]s.
439435
///
440436
/// [`char`]: prim@char
441-
/// [pattern]: self::pattern
442437
///
443438
/// # Text directionality
444439
///
@@ -457,11 +452,10 @@ impl FuriString {
457452
///
458453
/// If the string does not start with `prefix`, returns `false`.
459454
///
460-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
455+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
461456
/// [`char`]s.
462457
///
463458
/// [`char`]: prim@char
464-
/// [pattern]: self::pattern
465459
#[must_use]
466460
pub fn strip_prefix<P: Pattern>(&mut self, prefix: P) -> bool {
467461
prefix.strip_prefix_of(self)
@@ -474,11 +468,10 @@ impl FuriString {
474468
///
475469
/// If the string does not end with `suffix`, returns `false`.
476470
///
477-
/// The [pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
471+
/// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
478472
/// [`char`]s.
479473
///
480474
/// [`char`]: prim@char
481-
/// [pattern]: self::pattern
482475
#[must_use]
483476
pub fn strip_suffix<P: Pattern>(&mut self, suffix: P) -> bool {
484477
suffix.strip_suffix_of(self)

crates/flipperzero/src/furi/string/iter.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ pub unsafe fn next_code_point<'a, I: Iterator<Item = &'a u8>>(bytes: &mut I) ->
2121

2222
/// An iterator over the [`char`]s of a string.
2323
///
24-
/// This struct is created by the [`chars`] method on [`FuriString`]. See its
24+
/// This struct is created by the [`chars_lossy`] method on [`FuriString`]. See its
2525
/// documentation for more.
2626
///
2727
/// [`char`]: prim@char
28-
/// [`chars`]: FuriString::chars
28+
/// [`chars_lossy`]: super::FuriString::chars_lossy
29+
/// [`FuriString`]: super::FuriString
2930
#[derive(Clone)]
3031
#[must_use = "iterators are lazy and do nothing unless consumed"]
3132
pub struct Chars<'a> {
@@ -65,11 +66,12 @@ impl FusedIterator for Chars<'_> {}
6566

6667
/// An iterator over the [`char`]s of a string, and their positions.
6768
///
68-
/// This struct is created by the [`char_indices`] method on [`FuriString`]. See its
69+
/// This struct is created by the [`char_indices_lossy`] method on [`FuriString`]. See its
6970
/// documentation for more.
7071
///
7172
/// [`char`]: prim@char
72-
/// [`char_indices`]: FuriString::char_indices
73+
/// [`char_indices_lossy`]: super::FuriString::char_indices_lossy
74+
/// [`FuriString`]: super::FuriString
7375
#[derive(Clone, Debug)]
7476
#[must_use = "iterators are lazy and do nothing unless consumed"]
7577
pub struct CharIndices<'a> {
@@ -112,7 +114,8 @@ impl FusedIterator for CharIndices<'_> {}
112114
/// This struct is created by the [`bytes`] method on [`FuriString`]. See its
113115
/// documentation for more.
114116
///
115-
/// [`bytes`]: FuriString::bytes
117+
/// [`bytes`]: super::FuriString::bytes
118+
/// [`FuriString`]: super::FuriString
116119
#[must_use = "iterators are lazy and do nothing unless consumed"]
117120
#[derive(Clone, Debug)]
118121
pub struct Bytes<'a>(pub(super) Copied<slice::Iter<'a, u8>>);

crates/flipperzero/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![cfg_attr(test, no_main)]
55
#![deny(rustdoc::broken_intra_doc_links)]
66

7-
#[cfg(feature = "alloc")]
7+
#[cfg(any(feature = "alloc", docsrs))]
88
extern crate alloc;
99

1010
pub mod dialogs;

crates/flipperzero/src/toolbox/crc32.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use flipperzero_sys as sys;
55
/// Equivalent to [`crc32fast::Hasher`].
66
///
77
/// [1]: https://en.wikipedia.org/wiki/Cyclic_redundancy_check
8+
///
9+
/// [`crc32fast::Hasher`]: https://docs.rs/crc32fast/latest/crc32fast/struct.Hasher.html
810
#[derive(Clone)]
911
pub struct Crc32 {
1012
state: u32,

crates/flipperzero/src/toolbox/md5.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ use flipperzero_sys as sys;
3030
/// [2]: https://www.kb.cert.org/vuls/id/836068
3131
/// [3]: https://dl.acm.org/citation.cfm?id=1724151
3232
/// [4]: https://tools.ietf.org/html/rfc6151
33+
///
34+
/// [`md5::Md5`]: https://docs.rs/md-5/latest/md5/type.Md5.html
3335
pub type Md5 = CoreWrapper<Md5Core>;
3436

3537
/// Core MD5 hasher.

crates/flipperzero/src/toolbox/sha256.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ use flipperzero_sys as sys;
1414
/// Equivalent to [`sha2::Sha256`].
1515
///
1616
/// [1]: https://en.wikipedia.org/wiki/SHA-2
17+
///
18+
/// [`sha2::Sha256`]: https://docs.rs/sha2/latest/sha2/type.Sha256.html
1719
pub type Sha256 = CoreWrapper<Sha256Core>;
1820

1921
/// Core block-level SHA-256 hasher.

crates/sys/src/inlines/furi_hal_gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Inlines for Furi HAL GPIO interface.
22
//!
3-
//! See: https://github.com/flipperdevices/flipperzero-firmware/blob/release/firmware/targets/f7/furi_hal/furi_hal_gpio.h
3+
//! See: <https://github.com/flipperdevices/flipperzero-firmware/blob/release/firmware/targets/f7/furi_hal/furi_hal_gpio.h>
44
55
use crate as sys;
66

tools/src/bin/run-fap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct Cli {
2222

2323
/// Arguments to provide to the FAP binary.
2424
///
25-
/// Ignored until https://github.com/flipperdevices/flipperzero-firmware/issues/2505 is resolved.
25+
/// Ignored until <https://github.com/flipperdevices/flipperzero-firmware/issues/2505> is resolved.
2626
args: Vec<String>,
2727
}
2828

tools/src/bin/storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Storage CLI.
22
//!
3-
//! See: https://github.com/flipperdevices/flipperzero-firmware/blob/dev/scripts/storage.py
3+
//! See: <https://github.com/flipperdevices/flipperzero-firmware/blob/dev/scripts/storage.py>
44
55
use std::path::PathBuf;
66
use std::process;

0 commit comments

Comments
 (0)