ascii
ASCII-only equivalents to `char`, `str` and `String`.
1.1.0
105M downloads/mo
#786 most downloaded on crates.io
tomprogrammer/rust-ascii
What this package is like to depend on
Last release 4 years ago
no release in 18 months
Ships unpredictably
gaps range from 6 weeks to 3.1 years
Some releases are documented
notes for 9 of 22 stable releases
11 versions withdrawn
withdrawn after publishing
12 years old
33 releases · first in 2014
0 releases in the last 12 months
see the full history below
Release timeline
33 releases · Nov 2014 to Sep 2022Releases
latest 33-
1.1.018 Sep 2022Release notes
Open source →- Add alloc feature.
This enables
AsciiStringand methods that take or returnBox<[AsciiStr]>in!#[no_std]-mode. - Add
AsciiStr::into_ascii_string(),AsciiString::into_boxed_ascii_str()andAsciiString::insert_str(). - Implement
From<Box<AsciiStr>>andFrom<AsciiChar>forAsciiString. - Implement
From<AsciiString>forBox<AsciiStr>,Rc<AsciiStr>,Arc<AsciiStr>andVec<AsciiChar>. - Make
AsciiString::new(),AsciiStr::len()andAsciiStr::is_empty()const fn. - Require Rust 1.44.1.
- Add alloc feature.
This enables
-
1.0.026 Aug 2019Release notes
Open source →Breaking changes:
- Change
AsciiChar.is_whitespace()to also return true for '\0xb' (vertical tab) and '\0xc' (form feed). - Remove quickcheck feature.
- Remove
AsciiStr::new(). - Rename
AsciiChar::from()andAsciiChar::from_unchecked()tofrom_ascii()andfrom_ascii_unchecked(). - Rename several
AsciiChar.is_xxx()methods tois_ascii_xxx()(for comsistency with std). - Rename
AsciiChar::NulltoNul(for consistency with eg.CStr::from_bytes_with_nul()). - Rename
AsciiStr.trim_left()andAsciiStr.trim_right()totrim_start()andtrim_end(). - Remove impls of the deprecated
std::ascii::AsciiExttrait. - Change iterators
Chars,CharsMutandCharsReffrom type aliases to newtypes. - Return
impl TraitfromAsciiStr.lines()andAsciiStr.split(), and remove iterator typesLinesandSplit. - Add
slice_ascii_str(),get_ascii()andunwrap_ascii()to theAsAsciiStrtrait. - Add
slice_mut_ascii_str()andunwrap_ascii_mut()to theAsMutAsciiStrtrait. - Require Rust 1.33.0 for 1.0.*, and allow later semver-compatible 1.y.0 releases to increase it.
Additions:
- Add
const fnAsciiChar::new()which panicks on invalid values. - Make most
AsciiCharmethodsconst fn. - Add multiple
AsciiChar::is_[ascii_]xxx()methods. - Implement
AsRef<AsciiStr>forAsciiChar. - Make
AsciiString'sExtendandFromIteratorimpl generic over allAsRef<AsciiStr>. - Implement inclusive range indexing for
AsciiStr(and therebyAsciiString). - Mark
AsciiStrandAsciiString#[repr(transparent)](to[AsciiChar]andVec<AsciiChar>respectively).
- Change
-
0.9.326 Aug 2019Release notes
Open source →Soundness fix:
Remove unsound impls of
From<&mut AsciiStr>for&mut [u8]and&mut str. This is a breaking change, but theese impls can lead to undefined behavior in safe code.If you use this impl and know that non-ASCII values are never inserted into the
[u8]orstr, you can pin ascii to 0.9.2.Other changes:
- Make quickcheck
Arbitraryimpl sometimes produceAsciiChar::DEL. - Implement
Clone,CopyandEqforToAsciiCharError. - Implement
ToAsciiCharforu16,u32andi8.
- Make quickcheck
-
0.9.207 Jul 2019 withdrawnRelease notes
Open source →- Implement the
IntoAsciiStringtrait forstd::ffi::CStrandstd::ffi::CStringtypes, and implemented theAsAsciiStrtrait forstd::ffi::CStrtype. - Implement the
IntoAsciiStringforstd::borrow::Cow, where the inner types themselves implementIntoAsciiString. - Implement conversions between
AsciiStringandCow<'a, AsciiStr>. - Implement the
std::ops::AddAssigntrait forAsciiString. - Implement
BorrowMut<AsciiStr>,AsRef<[AsciiChar]>,AsRef<str>,AsMut<[AsciiChar]>forAsciiString. - Implement
PartialEq<[u8]>andPartialEq<[AsciiChar]>forAsciiStr. - Add
AsciiStr::first(),AsciiStr::last()andAsciiStr::split()methods. - Implement
DoubleEndedIteratorforAsciiStr::lines(). - Implement
AsRef<AsciiStr>andAsMut<AsciiStrfor[AsciiChar]. - Implement
DefaultforAsciiChar.
- Implement the
-
0.9.112 Sep 2018 withdrawnRelease notes
Open source →- Implement the
serde::Serializeandserde::Deserializetraits forAsciiChar,AsciiStr, andAsciiString. The implementation is enabled by theserdefeature. - Bugfix:
AsciiStr::lines()now behaves similar tostr::lines(). (#51)
- Implement the
-
0.9.005 Apr 2018 withdrawn -
0.8.705 Apr 2018Release notes
Open source →- Implement
AsAsciiStrandAsMutAsciiStrfor references to to types that implement them. - Make all methods of deprecated
AsciiExtexceptis_ascii()available as inherent methods in std-mode. - Compile without warnings on Rust 1.26.0
- Acknowledge that the crate doesn't compile on Rust < 1.8.0 (cannot be fixed without breaking changes).
- Implement
-
0.8.602 Jul 2017 withdrawn -
0.8.502 Jul 2017 withdrawnNothing published for this version
-
0.8.418 Apr 2017 withdrawn -
0.8.318 Apr 2017 withdrawnRelease notes
Open source →- Bugfix:
<AsciiStr as AsciiExt>::to_ascii_lowercasedid erroneously convert to uppercase.
- Bugfix:
-
0.8.217 Apr 2017 withdrawnRelease notes
Open source →- Implement
IntoAsciiStringfor&'a strand&'a [u8]. - Implement the
quickcheck::Arbitrarytrait forAsciiCharandAsciiString. The implementation is enabled by thequickcheckfeature.
- Implement
-
0.8.111 Feb 2017 withdrawnRelease notes
Open source →- Add
Chars,CharsMutandLinesiterators. - Implement
std::fmt::WriteforAsciiString.
- Add
-
0.8.002 Jan 2017 withdrawnRelease notes
Open source →Breaking changes:
- Return
FromAsciiErrorinstead of the input whenAsciiString::from_ascii()orinto_ascii_string()fails. - Replace the
no_stdfeature with the additivestdfeature, which is part of the default features. (Issue #29) AsciiChar::is_*()and::as_{byte,char}()takeselfby value instead of by reference.
Additions:
- Make
AsciiCharcomparable withcharandu8. - Add
AsciiChar::as_printable_char()and the free functionscaret_encode()andcaret_decode(). - Implement some methods from
AsciiExtandError(which are not in libcore) directly incoremode:Ascii{Char,Str}::eq_ignore_ascii_case()AsciiChar::to_ascii_{upper,lower}case()AsciiStr::make_ascii_{upper,lower}case(){ToAsciiChar,AsAsciiStr}Error::description()
- Return
-
0.7.115 Aug 2016Release notes
Open source →- Fix the implementation of
AsciiExt::to_ascii_lowercase()forAsciiCharconverting to uppercase. (introduced in 0.7.0)
- Fix the implementation of
-
0.7.025 Jun 2016 withdrawnRelease notes
Open source →- Rename
AsciitoAsciiCharand convert it into an enum. (with a variant for every ASCII character) - Replace
OwnedAsciiCastwithIntoAsciiString. - Replace
AsciiCastwithAs[Mut]AsciiStrandIntoAsciiChar. - Add from[_ascii]_unchecked methods.
- Replace from_bytes with from_ascii in method names.
- Return
std::error::Error-implementing types instead of()andNonewhen conversion toAsciiStrorAsciiCharfails. - Implement
AsciiExtwithout theunstableCargo feature flag, which is removed. - Require Rust 1.9 or later.
- Add
#[no_std]support in a Cargo feature. - Implement
From<{&,&mut,Box<}AsciiStr>for[Ascii],[u8]andstr - Implement
From<{&,&mut,Box<}[Ascii]>,As{Ref,Mut}<[Ascii]>and Default forAsciiStr - Implement
From<Vec<Ascii>>forAsciiString. - Implement
AsMut<AsciiStr>forAsciiString. - Stop some
Ascii::is_xxx()methods from panicking. - Add
Ascii::is_whitespace(). - Add
AsciiString::as_mut_slice(). - Add raw pointer methods on
AsciiString:from_raw_partsas_ptras_mut_ptr
- Rename
-
0.6.030 Dec 2015 -
0.5.429 Jul 2015 -
0.5.329 Jul 2015Nothing published for this version
-
0.5.216 Jul 2015Nothing published for this version
-
0.5.113 Jun 2015Release notes
Open source →- Add
Ascii::from(). - Implement
IndexforAsciiStrandAsciiString. - Implement
Default,FromIterator,ExtendandAddforAsciiString - Added inherent methods on
AsciiString:with_capacitypush_strcapacityreservereserve_exactshrink_to_fitpushtruncatepopremoveinsertlenis_emptyclear
- Add
-
0.5.005 May 2015 -
0.4.118 Apr 2015Nothing published for this version
-
0.4.008 Apr 2015Nothing published for this version
-
0.3.007 Apr 2015Nothing published for this version
-
0.2.522 Feb 2015Nothing published for this version
-
0.2.424 Jan 2015Nothing published for this version
-
0.2.311 Jan 2015Nothing published for this version
-
0.2.204 Jan 2015Nothing published for this version
-
0.2.129 Dec 2014Nothing published for this version
-
0.2.016 Dec 2014Nothing published for this version
-
0.1.016 Dec 2014Nothing published for this version
-
0.0.127 Nov 2014Nothing published for this version