Skip to content

Commit 29852c9

Browse files
waywardmonkeysmadsmtm
authored andcommitted
no_std: Don't use the std prelude
By being `no_std` and then using the `std` crate when the `std` feature is enabled, it is easier to detect when something requires `std` during development.
1 parent 896a8a3 commit 29852c9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
77
#![warn(clippy::doc_markdown)]
88
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
9-
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
9+
#![no_std]
1010

1111
extern crate alloc;
1212

13+
#[cfg(feature = "std")]
14+
extern crate std;
15+
1316
use alloc::string::{String, ToString};
1417
use core::fmt;
1518
use core::str::FromStr;

src/webdriver.rs

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
//!
4242
//! Specification: <https://w3c.github.io/webdriver/>
4343
44+
use alloc::borrow::ToOwned;
45+
use alloc::string::{String, ToString};
46+
use alloc::vec::Vec;
4447
use std::collections::HashSet;
4548

4649
use unicode_segmentation::UnicodeSegmentation;

0 commit comments

Comments
 (0)