61 Commits (0d8877536674899abd2de4cbe89437342f94cc27)

Author SHA1 Message Date
pantonshire 0d88775366 strings: implement push and push_truncating for CappedString
This patch implements the `CappedString::push` and
`CappedString::push_truncating` methods, which are like
`CappedString::push_str` and friends but take a single character rather
than a string slice.
3 years ago
pantonshire 2d5343681a strings: WIP CappedString::push_str and friends
This patch implements `CappedString::push_str` and its truncating
counterpart, `CappedString::push_str_truncating`. These methods provide
a safe API to append additional string data to the end of a
`CappedString`.

This is a work-in-progress and, like the rest of `CappedString`,
requires unit testing.
3 years ago
pantonshire c50b3c7daa strings: implement `CappedString::new` using `CappedString::from_raw_ptr`
This patch replaces the logic in `CappedString::new` for copying the
string data into a `[MaybeUninit<u8>]` buffer with a call to
`CappedString::from_raw_ptr`, which performs the same task.
3 years ago
pantonshire 4917be0963 strings: WIP CappedString refactoring and improvements
This patch changes the name of the CappedString error type to be more
descriptive, adds inline and must_use annotations to more public
functions, and begins implementing a wider variety of ways to create a
CappedString.
3 years ago
pantonshire c8783caae2 strings: CappedString now uses a MaybeUninit buf
CappedString was previously backed by a `[u8; N]`, which required
zeroing the buffer on creation. It now uses a `[MaybeUninit<u8>; N]`,
which does need to be zeroed. This should improve the performance of
creating a new CappedString, at the cost of slightly more unsafe code
required in its implementation.

Additionally, `as_bytes` and `as_bytes_mut` methods were introduced.
These are primarily used internally in the implementation of
CappedString, but are also provided as part of the public API to allow
users to do low-level operations on the underlying buffer backing the
CappedString. `as_bytes_mut` is unsafe, as this method can be used to
violate the UTF-8 property of the CappedString, which is undefined
behaviour.
3 years ago
pantonshire 5e612f153c Deny unsafe_op_in_unsafe_fn
The unsafe_op_in_unsafe_fn lint was previously set to allow, meaning
that unsafe function calls and operations were allowed within unsafe
functions without a surrounding unsafe block. This patch changes the
lint to deny, for the purpose of making unsafe operations in the
codebase more explicit.
3 years ago
pantonshire 299553bebf Documentation for CappedString 3 years ago
pantonshire d4c064c92e Conversions between CappedString and Box<str> 3 years ago
pantonshire ab9c62d993 Documentation 3 years ago
pantonshire 8f263e330a Optional decoding of plus character in percent encoded strings 3 years ago
pantonshire f0cc229a65 Percent decoding compliant with URL standard, export percent encoder and decoder types 3 years ago
pantonshire 2b27819104 Percent encode to String buffer 3 years ago
pantonshire d0ea531c05 RFC 3986 percent encoding, std feature now depends on alloc feature 3 years ago
pantonshire 5435784506 Make use of FixedString for hex encoding 3 years ago
pantonshire 8b605ca5c9 Fix for UUID 3 years ago
pantonshire 5535231475 Hex encoding functions now return arrays rather than tuples 3 years ago
Pantonshire 0e03fa87ba Fix doc tests for hex module 3 years ago
Pantonshire cf2648dde6 Seal the encoding::hex::Encode trait 3 years ago
Pantonshire eff2fab679 Encoding module 3 years ago
Pantonshire d1ca94954b impl Clone for InliningString 3 years ago
Pantonshire 5ca54944e8 Move the experimental InliningString to the inlining module 3 years ago
Pantonshire 6d6d35f2e0 More conversion functions for InliningString 3 years ago
Pantonshire 8e733c444d Remove debugging info and use new serde::Deserialize impl for experimental InliningString 3 years ago
Pantonshire 45ae1c68eb Improved serde support 3 years ago
Pantonshire 0b4dbc6bc5 no_std support 3 years ago
Pantonshire c601e806dd Improve experimental InliningString documentation 3 years ago
Pantonshire b066273e66 Fixes to names and comments 3 years ago
Pantonshire 6bd8c8a111 Implement more traits for experimental InliningString 3 years ago
Pantonshire 821c75729d Experimental InliningString::empty, rename experimental ShString23 3 years ago
Pantonshire b10507ae24 Rename experimental ShString and enable the niche optimisation 3 years ago
Pantonshire 4d4e4486d1 ShString is now InliningString 3 years ago
Pantonshire 6211e60319 Add InlineStringError to strings module, rename ShString repr variant 3 years ago
Pantonshire 74e2bbf406 Rename StackString to InlineString to reflect the fact that it may not always be on the stack, rename modules 3 years ago
Pantonshire da09d5015b Documentation and API improvements to Either 3 years ago
Pantonshire 78ee3cfb4e Experimental ShString now supports efficient conversion to String 3 years ago
Pantonshire a9c431627b Fix clippy lint in convert module 3 years ago
Pantonshire 23df5f425f Minor formatting fix 3 years ago
Pantonshire b6f60fcfc3 Experimental ShString no longer needlessly zeroes memory, added experimental ShString23 3 years ago
Pantonshire 93a8cefd06 ShString now uses the StackString from the public API 3 years ago
Pantonshire 85de7505e5 Extra little test case :3 3 years ago
Pantonshire d0f9044222 Move StackString to its own public module 3 years ago
Pantonshire 56179ac613 impl Serialize and Deserialize for ShString 4 years ago
Pantonshire c077cdf610 Proof of concept improvement for ShString 4 years ago
Pantonshire 4dd61aeaa2 FixedString data structure, improved UUID string encoding 4 years ago
Pantonshire da5f2235d2 Move ShString to its own submodule 4 years ago
Pantonshire 18767a8837 Serde support for uuid 4 years ago
Pantonshire c0f0a3a017 Note to self as a todo comment 4 years ago
Pantonshire bd2b3a8a29 impl Default for Uuid 4 years ago
Pantonshire 66f3bee9fc Remove sqlx feature, empty ShString function 4 years ago
Pantonshire ca1c08a6d7 UUID module, currently supporting UUID v5 4 years ago