Replace deprecated elements (#10999)

# Objective

- Replace deprecated elements.

## Solution

- Remove 'std::' from constants.
This commit is contained in:
Tygyh 2023-12-17 00:24:49 +01:00 committed by GitHub
parent 8ccde4a006
commit 645625b789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View File

@ -54,7 +54,7 @@ impl Default for TaskPoolOptions {
TaskPoolOptions { TaskPoolOptions {
// By default, use however many cores are available on the system // By default, use however many cores are available on the system
min_total_threads: 1, min_total_threads: 1,
max_total_threads: std::usize::MAX, max_total_threads: usize::MAX,
// Use 25% of cores for IO, at least 1, no more than 4 // Use 25% of cores for IO, at least 1, no more than 4
io: TaskPoolThreadAssignmentPolicy { io: TaskPoolThreadAssignmentPolicy {
@ -73,7 +73,7 @@ impl Default for TaskPoolOptions {
// Use all remaining cores for compute (at least 1) // Use all remaining cores for compute (at least 1)
compute: TaskPoolThreadAssignmentPolicy { compute: TaskPoolThreadAssignmentPolicy {
min_threads: 1, min_threads: 1,
max_threads: std::usize::MAX, max_threads: usize::MAX,
percent: 1.0, // This 1.0 here means "whatever is left over" percent: 1.0, // This 1.0 here means "whatever is left over"
}, },
} }

View File

@ -380,15 +380,15 @@ mod tests {
Err(InvalidDirectionError::Zero) Err(InvalidDirectionError::Zero)
); );
assert_eq!( assert_eq!(
Direction2d::new(Vec2::new(std::f32::INFINITY, 0.0)), Direction2d::new(Vec2::new(f32::INFINITY, 0.0)),
Err(InvalidDirectionError::Infinite) Err(InvalidDirectionError::Infinite)
); );
assert_eq!( assert_eq!(
Direction2d::new(Vec2::new(std::f32::NEG_INFINITY, 0.0)), Direction2d::new(Vec2::new(f32::NEG_INFINITY, 0.0)),
Err(InvalidDirectionError::Infinite) Err(InvalidDirectionError::Infinite)
); );
assert_eq!( assert_eq!(
Direction2d::new(Vec2::new(std::f32::NAN, 0.0)), Direction2d::new(Vec2::new(f32::NAN, 0.0)),
Err(InvalidDirectionError::NaN) Err(InvalidDirectionError::NaN)
); );
} }

View File

@ -393,15 +393,15 @@ mod test {
Err(InvalidDirectionError::Zero) Err(InvalidDirectionError::Zero)
); );
assert_eq!( assert_eq!(
Direction3d::new(Vec3::new(std::f32::INFINITY, 0.0, 0.0)), Direction3d::new(Vec3::new(f32::INFINITY, 0.0, 0.0)),
Err(InvalidDirectionError::Infinite) Err(InvalidDirectionError::Infinite)
); );
assert_eq!( assert_eq!(
Direction3d::new(Vec3::new(std::f32::NEG_INFINITY, 0.0, 0.0)), Direction3d::new(Vec3::new(f32::NEG_INFINITY, 0.0, 0.0)),
Err(InvalidDirectionError::Infinite) Err(InvalidDirectionError::Infinite)
); );
assert_eq!( assert_eq!(
Direction3d::new(Vec3::new(std::f32::NAN, 0.0, 0.0)), Direction3d::new(Vec3::new(f32::NAN, 0.0, 0.0)),
Err(InvalidDirectionError::NaN) Err(InvalidDirectionError::NaN)
); );
} }

View File

@ -213,8 +213,8 @@ where
T: ab_glyph::Font, T: ab_glyph::Font,
{ {
let mut text_bounds = Rect { let mut text_bounds = Rect {
min: Vec2::splat(std::f32::MAX), min: Vec2::splat(f32::MAX),
max: Vec2::splat(std::f32::MIN), max: Vec2::splat(f32::MIN),
}; };
for sg in section_glyphs { for sg in section_glyphs {