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.
2022-09-08 16:20:17 +01:00
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.
2022-09-08 16:08:14 +01:00
pantonshire
299553bebf
Documentation for CappedString
2022-09-08 13:58:03 +01:00
pantonshire
d4c064c92e
Conversions between CappedString and Box<str>
2022-09-08 13:34:37 +01:00
pantonshire
ab9c62d993
Documentation
2022-09-07 14:41:41 +01:00
pantonshire
8f263e330a
Optional decoding of plus character in percent encoded strings
2022-09-06 21:23:51 +01:00
pantonshire
f0cc229a65
Percent decoding compliant with URL standard, export percent encoder and decoder types
2022-09-06 15:42:32 +01:00
pantonshire
2b27819104
Percent encode to String buffer
2022-08-29 11:16:10 +01:00
pantonshire
d0ea531c05
RFC 3986 percent encoding, std feature now depends on alloc feature
2022-08-26 15:00:11 +01:00
pantonshire
5435784506
Make use of FixedString for hex encoding
2022-08-24 20:31:56 +01:00
pantonshire
8b605ca5c9
Fix for UUID
2022-08-24 17:33:37 +01:00
pantonshire
5535231475
Hex encoding functions now return arrays rather than tuples
2022-08-24 17:20:53 +01:00
Pantonshire
0e03fa87ba
Fix doc tests for hex module
2022-08-24 14:14:04 +01:00
Pantonshire
cf2648dde6
Seal the encoding::hex::Encode trait
2022-08-18 11:54:06 +01:00
Pantonshire
eff2fab679
Encoding module
2022-08-18 11:52:28 +01:00
Pantonshire
d1ca94954b
impl Clone for InliningString
2022-08-01 12:08:06 +02:00
Pantonshire
5ca54944e8
Move the experimental InliningString to the inlining module
2022-07-23 15:18:54 +01:00
Pantonshire
6d6d35f2e0
More conversion functions for InliningString
2022-07-22 17:46:45 +01:00
Pantonshire
f72b53e84f
Improve test script
2022-07-22 17:44:36 +01:00
Pantonshire
8e733c444d
Remove debugging info and use new serde::Deserialize impl for experimental InliningString
2022-07-21 13:34:56 +01:00
Pantonshire
45ae1c68eb
Improved serde support
2022-07-21 13:29:09 +01:00
Pantonshire
0b4dbc6bc5
no_std support
2022-07-21 13:01:33 +01:00
Pantonshire
78b940ff19
Bash script for miri testing
2022-07-21 10:20:09 +01:00
Pantonshire
c601e806dd
Improve experimental InliningString documentation
2022-07-21 10:19:15 +01:00
Pantonshire
b066273e66
Fixes to names and comments
2022-07-15 17:10:48 +01:00
Pantonshire
6bd8c8a111
Implement more traits for experimental InliningString
2022-07-15 16:31:12 +01:00
Pantonshire
821c75729d
Experimental InliningString::empty, rename experimental ShString23
2022-07-15 16:24:17 +01:00
Pantonshire
b10507ae24
Rename experimental ShString and enable the niche optimisation
2022-07-15 15:56:26 +01:00
Pantonshire
4d4e4486d1
ShString is now InliningString
2022-07-14 11:14:45 +01:00
Pantonshire
6211e60319
Add InlineStringError to strings module, rename ShString repr variant
2022-07-14 09:26:10 +01:00
Pantonshire
74e2bbf406
Rename StackString to InlineString to reflect the fact that it may not always be on the stack, rename modules
2022-07-14 09:21:01 +01:00
Pantonshire
da09d5015b
Documentation and API improvements to Either
2022-07-14 09:02:48 +01:00
Pantonshire
78ee3cfb4e
Experimental ShString now supports efficient conversion to String
2022-07-13 14:49:38 +01:00
Pantonshire
a9c431627b
Fix clippy lint in convert module
2022-07-12 19:36:51 +01:00
Pantonshire
23df5f425f
Minor formatting fix
2022-07-12 14:50:13 +01:00
Pantonshire
b6f60fcfc3
Experimental ShString no longer needlessly zeroes memory, added experimental ShString23
2022-07-12 14:46:39 +01:00
Pantonshire
93a8cefd06
ShString now uses the StackString from the public API
2022-07-12 14:46:01 +01:00
Pantonshire
85de7505e5
Extra little test case :3
2022-07-12 12:09:37 +01:00
Pantonshire
d0f9044222
Move StackString to its own public module
2022-07-12 12:09:16 +01:00
Pantonshire
378800ce89
No longer require default features for serde
2022-06-02 22:24:50 +01:00
Pantonshire
56179ac613
impl Serialize and Deserialize for ShString
2022-06-02 22:08:58 +01:00
Pantonshire
c077cdf610
Proof of concept improvement for ShString
2022-06-02 21:27:43 +01:00
Pantonshire
4dd61aeaa2
FixedString data structure, improved UUID string encoding
2022-06-02 15:35:35 +01:00
Pantonshire
da5f2235d2
Move ShString to its own submodule
2022-06-01 17:37:03 +01:00
Pantonshire
18767a8837
Serde support for uuid
2022-06-01 17:35:52 +01:00
Pantonshire
c0f0a3a017
Note to self as a todo comment
2022-05-25 20:22:04 +01:00
Pantonshire
bd2b3a8a29
impl Default for Uuid
2022-05-25 15:45:48 +01:00
Pantonshire
66f3bee9fc
Remove sqlx feature, empty ShString function
2022-05-25 15:22:38 +01:00
Pantonshire
ca1c08a6d7
UUID module, currently supporting UUID v5
2022-05-25 14:14:27 +01:00
Pantonshire
62dae93140
Remove Bot type in favour of Empty trait
2022-05-17 16:01:54 +01:00
Pantonshire
6aebb1f104
Either type
2022-05-17 15:19:02 +01:00
Pantonshire
ee6f00c0e7
Documentation, const-ification, additional convert functions
2022-05-17 14:40:56 +01:00
Pantonshire
70fa5daf6c
Bottom type and infallible eliminator
2022-05-17 03:21:50 +01:00
Pantonshire
569e291cd3
Remove TODO comment
2022-05-16 21:15:45 +01:00
Pantonshire
8ba4dbcce6
impl AsMut<str> for ShString
2022-05-16 15:18:13 +01:00
Pantonshire
8b1fd457a8
Mark several functions as inline and must_use
2022-05-15 20:08:14 +01:00
Pantonshire
c3cbc20afb
Mention upper bound of const parameter N in ShString documentation
2022-05-15 18:30:10 +01:00
Pantonshire
c4291ea488
Minor documentation fix
2022-05-15 18:20:39 +01:00
Pantonshire
d095ae8d96
Tests and doctests
2022-05-15 18:19:34 +01:00
Pantonshire
fdb0e16fa3
Initial commit
2022-05-15 17:14:39 +01:00