Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on clippy::std_instead_of_core and other related lints. #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/font/system/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

use std::{
collections::HashMap,
sync::{Arc, Mutex},
sync::Mutex,
};
use alloc::sync::Arc;

use crate::{Attrs, AttrsOwned, Font, FontMatches};

Expand Down Expand Up @@ -31,7 +32,7 @@ impl FontSystem {
/// while debug builds can take up to ten times longer. For this reason, it should only be
/// called once, and the resulting [`FontSystem`] should be shared.
pub fn new() -> Self {
Self::new_with_fonts(std::iter::empty())
Self::new_with_fonts(core::iter::empty())
}

pub fn new_with_fonts(fonts: impl Iterator<Item = fontdb::Source>) -> Self {
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
#![warn(clippy::semicolon_if_nothing_returned)]
// Ensure numbers are readable
#![warn(clippy::unreadable_literal)]
// Warn if any std or alloc types are used when the types are available in alloc or core instead.
#![warn(clippy::std_instead_of_core)]
#![warn(clippy::std_instead_of_alloc)]
#![warn(clippy::alloc_instead_of_core)]
#![cfg_attr(not(feature = "std"), no_std)]

extern crate alloc;
Expand Down