src: use core instead of std in some places, aiming for no_std compat

This commit is contained in:
2024-12-01 16:17:51 +01:00
parent 0f73b42818
commit 36aead9762
6 changed files with 15 additions and 15 deletions

View File

@ -2,8 +2,8 @@ use crate::geometry::*;
use crate::lib8::interpolate::scale8;
use std::cmp::{max, min};
use std::fmt::{Formatter, Debug};
use core::cmp::{max, min};
use core::fmt::{Formatter, Debug};
pub trait CoordinateView<'a>: Debug {
type Space: CoordinateSpace;
@ -216,7 +216,7 @@ pub struct StrideView<'a> {
}
impl<'a> Debug for StrideView<'a> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
f.debug_struct("StrideView")
.field("range", &self.range)
.field("step", &self.step_size)
@ -247,8 +247,8 @@ impl<'a> StrideView<'a> {
(map.size.width(), map.size.height())
);
let step_size = VirtualCoordinates::new(
u8::MAX / std::cmp::max(1, range.width()),
u8::MAX / std::cmp::max(1, range.height())
u8::MAX / core::cmp::max(1, range.width()),
u8::MAX / core::cmp::max(1, range.height())
//scale8(255, std::cmp::max(1, range.bottom_right.x - range.top_left.x)),
//scale8(255, std::cmp::max(1, range.bottom_right.y - range.top_left.y))
);