mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
clippy: Add safety documentation and clean up unsafe methods (#33748)
This change: 1. Adds safety documentation where it was missing. 2. Limits the scope of unsafe code in some cases to where it is actually unsafe. 3. Converts some free functions to associated functions and methods, thereby making them more likely to be called safely. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
ed959d7a1a
commit
30abb99287
14 changed files with 409 additions and 347 deletions
|
@ -656,7 +656,7 @@ impl<'a> CanvasData<'a> {
|
|||
ideographic_baseline,
|
||||
alphabetic_baseline,
|
||||
hanging_baseline,
|
||||
} = match font.get_baseline() {
|
||||
} = match font.baseline() {
|
||||
Some(baseline) => baseline,
|
||||
None => FontBaseline {
|
||||
hanging_baseline: ascent * HANGING_BASELINE_DEFAULT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue