2023-03-12 10:30:03 +01:00
|
|
|
use core::ops::{Deref, DerefMut};
|
|
|
|
|
|
2022-11-08 08:43:27 -07:00
|
|
|
#[cfg(not(feature = "std"))]
|
|
|
|
|
pub use self::no_std::*;
|
|
|
|
|
#[cfg(not(feature = "std"))]
|
|
|
|
|
mod no_std;
|
|
|
|
|
|
2023-03-08 20:44:26 -07:00
|
|
|
#[cfg(feature = "std")]
|
2022-11-08 08:43:27 -07:00
|
|
|
pub use self::std::*;
|
2023-03-08 20:44:26 -07:00
|
|
|
#[cfg(feature = "std")]
|
2022-11-08 08:43:27 -07:00
|
|
|
mod std;
|
2022-12-29 08:49:48 -08:00
|
|
|
|
|
|
|
|
// re-export fontdb
|
|
|
|
|
pub use fontdb;
|
2023-03-12 10:30:03 +01:00
|
|
|
|
|
|
|
|
pub struct BorrowedWithFontSystem<'a, T> {
|
|
|
|
|
pub(crate) inner: &'a mut T,
|
2023-03-12 10:30:09 +01:00
|
|
|
pub(crate) font_system: &'a mut FontSystem,
|
2023-03-12 10:30:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<'a, T> Deref for BorrowedWithFontSystem<'a, T> {
|
|
|
|
|
type Target = T;
|
|
|
|
|
|
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
|
self.inner
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<'a, T> DerefMut for BorrowedWithFontSystem<'a, T> {
|
|
|
|
|
fn deref_mut(&mut self) -> &mut Self::Target {
|
|
|
|
|
self.inner
|
|
|
|
|
}
|
|
|
|
|
}
|