Skip to content

Commit f8d8843

Browse files
authored
Merge pull request #131 from kas-gui/push-ourrnpqkrvms
Docs: fix links and use doc_cfg
2 parents b33a214 + 17366e3 commit f8d8843

File tree

8 files changed

+13
-16
lines changed

8 files changed

+13
-16
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
cargo fmt --all -- --check
2929
- name: doc
30-
run: RUSTDOCFLAGS="--cfg doc_cfg" cargo doc --all-features --no-deps
30+
run: RUSTDOCFLAGS="--cfg doc_cfg" cargo doc --all-features --no-deps -Zwarnings --config 'build.warnings="deny"'
3131
- name: Clippy
3232
run: cargo +nightly clippy --all-features
3333
- name: Test (all features including GAT)

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ rust-version = "1.88.0"
1515

1616
[package.metadata.docs.rs]
1717
# To build locally:
18-
# cargo +nightly doc --all-features --no-deps --open
18+
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --no-deps --open
1919
all-features = true
20+
rustdoc-args = ["--cfg", "docsrs"]
2021

2122
[features]
2223
# Support num_glyphs method

src/display/glyph_pos.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55

66
//! Methods using positioned glyphs
77
8-
#![allow(clippy::collapsible_else_if)]
9-
#![allow(clippy::or_fun_call)]
10-
#![allow(clippy::never_loop)]
11-
#![allow(clippy::needless_range_loop)]
12-
138
use super::{Line, TextDisplay};
149
use crate::conv::to_usize;
1510
use crate::fonts::{self, FaceId};
11+
#[allow(unused)]
12+
use crate::format::FormattableText;
1613
use crate::{Glyph, Range, Vec2, shaper};
1714

1815
/// Effect formatting marker
@@ -405,7 +402,7 @@ impl TextDisplay {
405402
}
406403

407404
// else: index < to_usize(run_part.text_end)
408-
let pos = 'b: loop {
405+
let pos = 'b: {
409406
if glyph_run.level.is_ltr() {
410407
for glyph in glyph_run.glyphs[run_part.glyph_range.to_std()].iter().rev() {
411408
if to_usize(glyph.index) <= index {
@@ -621,7 +618,7 @@ impl TextDisplay {
621618
.scale_by_dpu(glyph_run.dpu);
622619

623620
let b;
624-
'c: loop {
621+
'c: {
625622
if glyph_run.level.is_ltr() {
626623
for glyph in glyph_run.glyphs[run_part.glyph_range.to_std()].iter().rev() {
627624
if to_usize(glyph.index) <= range.end {

src/display/text_runs.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
//! Text preparation: line breaking and BIDI
77
8-
#![allow(clippy::unnecessary_unwrap)]
9-
108
use super::TextDisplay;
119
use crate::conv::{to_u32, to_usize};
1210
use crate::fonts::{self, FaceId, FontSelector, NoFontMatch};
@@ -362,7 +360,7 @@ impl TextDisplay {
362360
}
363361
}
364362

365-
let hard_break = ends_with_hard_break(&text);
363+
let hard_break = ends_with_hard_break(text);
366364

367365
// Following a hard break we have an implied empty line.
368366
if hard_break {
@@ -435,6 +433,7 @@ enum EmojiBreak {
435433
Error,
436434
}
437435

436+
#[allow(clippy::upper_case_acronyms)]
438437
enum EmojiState {
439438
None,
440439
RI1,

src/fonts/library.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
//! Font library
77
8-
#![allow(clippy::len_without_is_empty)]
9-
108
use super::{FaceRef, FontSelector, Resolver};
119
use crate::conv::{to_u32, to_usize};
1210
use fontique::{Blob, QueryStatus, Script, Synthesis};

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
//!
1414
//! [`format`]: mod@format
1515
16+
#![cfg_attr(docsrs, feature(doc_cfg))]
17+
1618
mod env;
1719
pub use env::*;
1820

src/shaper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ pub(crate) fn shape(
309309
face_id,
310310
special,
311311
level: input.level,
312-
script: input.script.into(),
312+
script: input.script,
313313

314314
glyphs,
315315
breaks,

src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a> Iterator for LineIterator<'a> {
7979
type Item = Range<usize>;
8080

8181
fn next(&mut self) -> Option<Self::Item> {
82-
while let Some(index) = self.break_iter.next() {
82+
for index in self.break_iter.by_ref() {
8383
if ends_with_hard_break(&self.text[..index]) || index == self.text.len() {
8484
let range = self.start..index;
8585
self.start = index;

0 commit comments

Comments
 (0)