You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By replacing this vector with an array, we can remove the std dependency. The allocation is only 524 bytes long, and it wouldn't be unreasonable to allocate it on the stack (Rust's default stack size is 2MiB, giving us plenty of room).
We'd also need to remove the utf16 conversion that allocates to a string here:
One solution would simply be to write s.contains(&[b'-' as u16, 'p' as _, 't' as _, 'y' as _]), but there's also https://docs.rs/utf16_lit which makes this more readable
The text was updated successfully, but these errors were encountered:
@Plecra Could you say what the use case is for no_std support on Windows? Where would it allow the use of this crate that is otherwise impossible today? Making the substring check even more obscure, for example, seems non-ideal.
atty/src/lib.rs
Line 131 in 7b5df17
By replacing this vector with an array, we can remove the std dependency. The allocation is only 524 bytes long, and it wouldn't be unreasonable to allocate it on the stack (Rust's default stack size is 2MiB, giving us plenty of room).
We'd also need to remove the utf16 conversion that allocates to a string here:
atty/src/lib.rs
Line 146 in 7b5df17
One solution would simply be to write
s.contains(&[b'-' as u16, 'p' as _, 't' as _, 'y' as _])
, but there's also https://docs.rs/utf16_lit which makes this more readableThe text was updated successfully, but these errors were encountered: