Skip to content

Commit

Permalink
simplify imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dfrg committed Mar 15, 2024
1 parent 48a32a5 commit 5fca840
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion skrifa/src/color/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::{
Brush, ColorPainter, ColorStop, PaintCachedColorGlyph, PaintError, Transform,
};

use crate::alloc_prelude::Vec;
use alloc::vec::Vec;

#[cfg(feature = "libm")]
#[allow(unused_imports)]
Expand Down
2 changes: 1 addition & 1 deletion skrifa/src/color/traversal_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{
};

use crate::{
alloc_prelude::Vec,
alloc::vec::Vec,
color::{
transform::Transform, traversal_tests::test_glyph_defs::*, Brush, ColorPainter, ColorStop,
},
Expand Down
11 changes: 0 additions & 11 deletions skrifa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,9 @@ compile_error!("Either feature \"std\" or \"libm\" must be enabled for this crat
#[macro_use]
extern crate core as std;

#[cfg(not(any(test, feature = "std")))]
#[macro_use]
extern crate alloc;

#[cfg(not(any(test, feature = "std")))]
mod alloc_prelude {
pub use alloc::{boxed::Box, vec::Vec};
}

#[cfg(any(test, feature = "std"))]
mod alloc_prelude {
pub use std::{boxed::Box, vec::Vec};
}

/// Expose our "raw" underlying parser crate.
pub extern crate read_fonts as raw;

Expand Down
2 changes: 1 addition & 1 deletion skrifa/src/outline/embedded_hinting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::{
cff, glyf, AdjustedMetrics, DrawError, Hinting, LocationRef, NormalizedCoord,
OutlineCollectionKind, OutlineGlyph, OutlineGlyphCollection, OutlineKind, OutlinePen, Size,
};
use crate::alloc_prelude::{Box, Vec};
use crate::alloc::{boxed::Box, vec::Vec};

/// Modes that control hinting when using embedded instructions.
///
Expand Down
2 changes: 1 addition & 1 deletion skrifa/src/outline/glyf/hint/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{
zone::Zone,
HintOutline, HintingMode, PointFlags,
};
use crate::alloc_prelude::Vec;
use alloc::vec::Vec;
use raw::types::{F26Dot6, F2Dot14, Fixed, Point};

#[derive(Clone, Default)]
Expand Down
2 changes: 1 addition & 1 deletion skrifa/src/small_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! available to us. In the meantime, this type should be kept small
//! with functionality only added when needed.
use crate::alloc_prelude::Vec;
use alloc::vec::Vec;
use core::fmt;
use std::ops::{Deref, DerefMut};

Expand Down

0 comments on commit 5fca840

Please sign in to comment.