|
76 | 76 | //! for stripping and taking ansi escape codes into account for length |
77 | 77 | //! calculations). |
78 | 78 |
|
79 | | -#![warn(unreachable_pub)] |
| 79 | +#![warn( |
| 80 | + unreachable_pub, |
| 81 | + clippy::std_instead_of_core, |
| 82 | + clippy::std_instead_of_alloc |
| 83 | +)] |
| 84 | +#![cfg_attr(not(feature = "std"), no_std)] |
| 85 | +#[cfg(feature = "alloc")] |
| 86 | +extern crate alloc; |
80 | 87 |
|
| 88 | +#[cfg(feature = "alloc")] |
81 | 89 | pub use crate::kb::Key; |
| 90 | +#[cfg(feature = "std")] |
82 | 91 | pub use crate::term::{ |
83 | 92 | user_attended, user_attended_stderr, Term, TermFamily, TermFeatures, TermTarget, |
84 | 93 | }; |
| 94 | +#[cfg(feature = "std")] |
85 | 95 | pub use crate::utils::{ |
86 | 96 | colors_enabled, colors_enabled_stderr, measure_text_width, pad_str, pad_str_with, |
87 | 97 | set_colors_enabled, set_colors_enabled_stderr, style, truncate_str, Alignment, Attribute, |
88 | 98 | Color, Emoji, Style, StyledObject, |
89 | 99 | }; |
90 | 100 |
|
| 101 | +#[cfg(all(feature = "ansi-parsing", feature = "alloc"))] |
| 102 | +pub use crate::ansi::strip_ansi_codes; |
91 | 103 | #[cfg(feature = "ansi-parsing")] |
92 | | -pub use crate::ansi::{strip_ansi_codes, AnsiCodeIterator}; |
| 104 | +pub use crate::ansi::AnsiCodeIterator; |
93 | 105 |
|
| 106 | +#[cfg(feature = "std")] |
94 | 107 | mod common_term; |
| 108 | +#[cfg(feature = "alloc")] |
95 | 109 | mod kb; |
| 110 | +#[cfg(feature = "std")] |
96 | 111 | mod term; |
97 | | -#[cfg(all(unix, not(target_arch = "wasm32")))] |
| 112 | +#[cfg(all(unix, not(target_arch = "wasm32"), feature = "std"))] |
98 | 113 | mod unix_term; |
| 114 | +#[cfg(feature = "std")] |
99 | 115 | mod utils; |
100 | | -#[cfg(target_arch = "wasm32")] |
| 116 | +#[cfg(all(feature = "std", target_arch = "wasm32"))] |
101 | 117 | mod wasm_term; |
102 | | -#[cfg(windows)] |
| 118 | +#[cfg(all(feature = "std", windows))] |
103 | 119 | mod windows_term; |
104 | 120 |
|
105 | 121 | #[cfg(feature = "ansi-parsing")] |
|
0 commit comments