commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
7856036c7928f00252626470d107018f3c7313fa | Simon Sapin | 2017-03-07T00:18:35 | Very much breaking | diff --git a/Cargo.toml b/Cargo.toml
index 13de3c5..1e904d0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "utf-8"
-version = "0.6.0"
+version = "0.7.0"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Incremental, zero-copy UTF-8 decoding with error handling"
license = "M... | 1 | 1 | 1 |
0bf333c265b794a7e21a698d3222aa20a915ca81 | Simon Sapin | 2017-03-07T00:11:53 | Tweak variable names | diff --git a/src/lib.rs b/src/lib.rs
index 5bebe4e..f4a1fcd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -83,17 +83,17 @@ impl IncompleteChar {
pub fn try_complete<'char, 'input>(&'char mut self, input: &'input [u8])
-> Option<(Result<&'char str, &'char [u8]>, &'input [u8])> ... | 1 | 9 | 9 |
f97b74e2e4f7f09a9bd1281e572c809e1ed82dbf | Simon Sapin | 2017-03-06T23:23:20 | Proper modules. | diff --git a/Cargo.toml b/Cargo.toml
index 5c9b987..13de3c5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,7 +8,6 @@ repository = "https://github.com/SimonSapin/rust-utf8"
[lib]
name = "utf8"
-path = "lib.rs"
test = false
bench = false
diff --git a/based_on_std.rs b/src/lib.rs
similarity index 91%
rename from b... | 4 | 13 | 11 |
4dfd056e216d170a9697fd2c61b4369fb0d54295 | Simon Sapin | 2017-03-06T22:10:20 | IncompleteChar::new | diff --git a/based_on_std.rs b/based_on_std.rs
index 8dffbbe..54440c7 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -5,20 +5,18 @@ include!("polyfill.rs");
#[derive(Debug, Copy, Clone)]
pub enum DecodeError<'a> {
+ /// In lossy decoding insert `valid_prefix`, then `"\u{FFFD}"`,
+ /// then call `decode... | 1 | 16 | 13 |
dc1fa1efff551e84d769e0d0fde5a3d44b57a0e3 | Simon Sapin | 2017-03-06T21:58:03 | Public fields over trivial methods | diff --git a/based_on_std.rs b/based_on_std.rs
index 83ef457..8dffbbe 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -25,8 +25,8 @@ pub enum DecodeError<'a> {
#[derive(Debug, Copy, Clone)]
pub struct IncompleteChar {
- buffer: [u8; 4],
- buffer_len: u8,
+ pub buffer: [u8; 4],
+ pub buffer_len: u8... | 2 | 8 | 20 |
1b2146a9e600856968e7946cc9b64238619e1b23 | Simon Sapin | 2017-03-06T20:44:03 | Actualy run tests, fix bugs
Turns out (1..1).iter() is empty. | diff --git a/Cargo.toml b/Cargo.toml
index b2d1fa0..5c9b987 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,7 +16,7 @@ bench = false
matches = "0.1.2"
[profile.test]
-opt-level = 3
+#opt-level = 3
[profile.bench]
#debug = true
diff --git a/based_on_std.rs b/based_on_std.rs
index df8cc2f..83ef457 100644
--- a/ba... | 5 | 35 | 19 |
d0d604f79598f7e31212e57d864bc9a05eb02035 | Simon Sapin | 2017-03-06T20:17:09 | resume_from -> error_len | diff --git a/based_on_std.rs b/based_on_std.rs
index 653bc52..df8cc2f 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -36,15 +36,13 @@ pub fn decode(input: &[u8]) -> Result<&str, DecodeError> {
};
// FIXME: separate function from here to guide inlining?
- let valid_up_to = error.valid_up_to();
- ... | 2 | 11 | 15 |
50b88791d793c0d5fb95d831d2aec23c6a4b8609 | Simon Sapin | 2017-03-06T18:57:43 | Add IncompleteChar::as_bytes | diff --git a/based_on_std.rs b/based_on_std.rs
index b92c5ec..653bc52 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -18,7 +18,7 @@ pub enum DecodeError<'a> {
valid_prefix: &'a str,
/// Call the `try_complete` method with more input is available.
- /// If no more input is available, th... | 1 | 6 | 2 |
9b639cc0aedfd215a2b81779dae22dedd4ef683e | Simon Sapin | 2017-03-06T18:55:35 | Replace DecodeResult with Result + DecodeError | diff --git a/based_on_std.rs b/based_on_std.rs
index 28cb10f..b92c5ec 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -4,9 +4,8 @@ use std::str;
include!("polyfill.rs");
#[derive(Debug, Copy, Clone)]
-pub enum DecodeResult<'a> {
- Ok(&'a str),
- Error {
+pub enum DecodeError<'a> {
+ Invalid {
... | 4 | 19 | 20 |
58057792cc5b9651ded6d8f5c4292c296099bed1 | Simon Sapin | 2017-03-06T18:47:52 | Use named fields in DecodeResult variants. | diff --git a/based_on_std.rs b/based_on_std.rs
index d4985a2..28cb10f 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -6,12 +6,23 @@ include!("polyfill.rs");
#[derive(Debug, Copy, Clone)]
pub enum DecodeResult<'a> {
Ok(&'a str),
- Error(&'a str, InvalidSequence<'a>, &'a [u8]),
- Incomplete(&'a str, I... | 4 | 42 | 23 |
2721bdedabd35e574f57d749d1ea769747e39ad0 | Simon Sapin | 2017-03-06T18:35:36 | Replace TryCompleteResult with Option and Result | diff --git a/based_on_std.rs b/based_on_std.rs
index b8d4d91..d4985a2 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -50,15 +50,12 @@ pub fn decode(input: &[u8]) -> DecodeResult {
}
}
-pub enum TryCompleteResult<'char, 'input> {
- Ok(&'char str, &'input [u8]),
- Error(InvalidSequence<'char>, &'inpu... | 2 | 15 | 18 |
5c8592bd13b2efcb4ea53bd72fdb1c1aa55fa753 | Simon Sapin | 2017-03-06T13:43:31 | Rewrite IncompleteChar::try_complete on top of str::from_utf8…
… and polyfilled Utf8Error::resume_from | diff --git a/based_on_std.rs b/based_on_std.rs
index 8a8e0e6..b8d4d91 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -1,3 +1,4 @@
+use std::cmp;
use std::str;
include!("polyfill.rs");
@@ -16,7 +17,6 @@ pub struct InvalidSequence<'a>(pub &'a [u8]);
pub struct IncompleteChar {
buffer: [u8; 4],
buffe... | 2 | 80 | 98 |
d0ebf6fec85ab9c83c131a6af5a1973d114849c2 | Simon Sapin | 2017-03-06T13:28:07 | Polyfill Utf8Error::resume_from | diff --git a/based_on_std.rs b/based_on_std.rs
index 28601d7..8a8e0e6 100644
--- a/based_on_std.rs
+++ b/based_on_std.rs
@@ -1,5 +1,7 @@
use std::str;
+include!("polyfill.rs");
+
#[derive(Debug, Copy, Clone)]
pub enum DecodeResult<'a> {
Ok(&'a str),
@@ -22,71 +24,31 @@ pub fn decode(input: &[u8]) -> DecodeRes... | 2 | 79 | 57 |
97d24075a63246f846021c1a9cab42cd8e33e716 | Simon Sapin | 2017-03-02T14:03:02 | Oops another rewrite | diff --git a/based_on_std.rs b/based_on_std.rs
new file mode 100644
index 0000000..aa916dc
--- /dev/null
+++ b/based_on_std.rs
@@ -0,0 +1,202 @@
+use std::str;
+
+#[derive(Debug, Copy, Clone)]
+pub enum DecodeResult<'a> {
+ Ok(&'a str),
+ Error(&'a str, InvalidSequence<'a>, &'a [u8]),
+ Incomplete(&'a str, Inc... | 2 | 204 | 0 |
c4bc93550925947678b0a922492610dacb664141 | Simon Sapin | 2016-01-24T16:58:03 | Generalizing StringWrapper isn’t that good an idea.
Switch back to a concrete InlineString type. | diff --git a/Cargo.toml b/Cargo.toml
index 53c2804..b2d1fa0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,9 +1,9 @@
[package]
name = "utf-8"
-version = "0.5.0"
+version = "0.6.0"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Incremental, zero-copy UTF-8 decoding with error handling"
-license = "M... | 2 | 50 | 15 |
8c936d75c6a2dec342f9afe0787e670e3fc54db5 | Simon Sapin | 2015-10-31T12:10:03 | More docs. | diff --git a/lib.rs b/lib.rs
index 9fef310..b0614ee 100644
--- a/lib.rs
+++ b/lib.rs
@@ -5,7 +5,7 @@ use std::result;
use std::str;
use string_wrapper::StringWrapper;
-/// The replacement character. In lossy decoding, insert it for every decoding error.
+/// The replacement character, U+FFFD. In lossy decoding, ins... | 1 | 55 | 14 |
860f37874e0f8d0e9cee965d01a12828532d8ac9 | Simon Sapin | 2015-10-30T08:39:44 | Slightly higher-level API again. *This* time it’s the right one! | diff --git a/Cargo.toml b/Cargo.toml
index a93900f..782af1c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "utf-8"
-version = "0.3.0"
+version = "0.4.0"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Incremental, zero-copy UTF-8 decoding with error handling"
license = "M... | 4 | 212 | 186 |
58ca1e874db8e474a02c7e3a89aac05c8e3fc33b | Simon Sapin | 2015-10-30T04:49:53 | Drop `Push` in the `PushLossyDecoder` name. | diff --git a/lib.rs b/lib.rs
index e75eb37..b2d6768 100644
--- a/lib.rs
+++ b/lib.rs
@@ -7,15 +7,15 @@ use string_wrapper::StringWrapper;
/// The replacement character. In lossy decoding, insert it for every decoding error.
pub const REPLACEMENT_CHARACTER: &'static str = "\u{FFFD}";
-pub struct PushLossyDecoder<F: ... | 2 | 6 | 6 |
62d33af96a893f6d887b9000c5493c8386385ac1 | Simon Sapin | 2015-10-30T04:33:02 | Rename DecodeStepStatus to Result. | diff --git a/lib.rs b/lib.rs
index 700aa18..e75eb37 100644
--- a/lib.rs
+++ b/lib.rs
@@ -33,12 +33,12 @@ impl<F: FnMut(&str)> PushLossyDecoder<F> {
let (s, status) = result;
(self.push_str)(s);
match status {
- DecodeStepStatus::Ok => break,
- DecodeS... | 3 | 21 | 21 |
e65bd282458f33834d350cd7826002709b293972 | Simon Sapin | 2015-10-29T16:32:30 | Use utf8 for the crate name anyway. | diff --git a/Cargo.toml b/Cargo.toml
index bf93584..db83ab5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,12 +1,13 @@
[package]
name = "utf-8"
-version = "0.1.0"
+version = "0.2.0"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Incremental, zero-copy UTF-8 decoding with error handling"
license = ... | 6 | 9 | 8 |
b394e7319fc4ac816789a0a4d2950acef9c64c99 | Simon Sapin | 2015-10-29T16:29:59 | The squatter of https://crates.io/crates/utf8 is not responsive. | diff --git a/Cargo.toml b/Cargo.toml
index d283058..bf93584 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "utf8"
+name = "utf-8"
version = "0.1.0"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Incremental, zero-copy UTF-8 decoding with error handling"
diff --git a/benc... | 6 | 8 | 8 |
82b6df1c770ad47e777fce70f76f7ed5ae71a855 | Simon Sapin | 2015-10-29T16:06:48 | Back to a low-level API. | diff --git a/Cargo.toml b/Cargo.toml
index dda130b..d283058 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,6 +13,7 @@ bench = false
[dependencies]
matches = "0.1.2"
+string-wrapper = "0.1.0"
[profile.test]
opt-level = 3
diff --git a/lib.rs b/lib.rs
index f2bab3a..700aa18 100644
--- a/lib.rs
+++ b/lib.rs
@@ -1,... | 5 | 230 | 340 |
8fe140b9f4c689863068c5e5619ecbea9c373210 | Simon Sapin | 2015-10-02T14:32:12 | Add benchmarks. | diff --git a/Cargo.toml b/Cargo.toml
index f79e3bc..dda130b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,3 +16,6 @@ matches = "0.1.2"
[profile.test]
opt-level = 3
+
+[profile.bench]
+#debug = true
diff --git a/lib.rs b/lib.rs
index e5ba8b8..f2bab3a 100644
--- a/lib.rs
+++ b/lib.rs
@@ -38,6 +38,7 @@ struct Incomp... | 3 | 10 | 1 |
18fdc507c30f4f95c310814adb07334afce956e9 | Simon Sapin | 2015-10-02T13:37:06 | Add benchmarks. | diff --git a/Cargo.toml b/Cargo.toml
index c052126..f79e3bc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,7 @@ repository = "https://github.com/SimonSapin/rust-utf8"
[lib]
path = "lib.rs"
test = false
+bench = false
[dependencies]
matches = "0.1.2"
diff --git a/benches/from_utf8_lossy.rs b/benches/from_utf... | 4 | 58 | 25 |
6606e23fae100fff3d0006bce2f6c70daad43b81 | Simon Sapin | 2015-10-02T11:54:58 | Fix an edge case of string_from_utf8_lossy and add a test | diff --git a/tests/shared/data.rs b/tests/shared/data.rs
index 1bef3ee..98cd0c8 100644
--- a/tests/shared/data.rs
+++ b/tests/shared/data.rs
@@ -5,6 +5,7 @@ pub const DECODED_LOSSY: &'static [(&'static [u8], &'static str)] = &[
(b"Hello\xC2 There\xFF Goodbye", "Hello\u{FFFD} There\u{FFFD} Goodbye"),
(b"Hello\... | 2 | 16 | 11 |
640eddd7672ba742f4dfeffaa08c61121c235e0a | Simon Sapin | 2015-10-02T11:17:12 | Use eof() in string_from_utf8_lossy. | diff --git a/lib.rs b/lib.rs
index b17b286..2990360 100644
--- a/lib.rs
+++ b/lib.rs
@@ -54,7 +54,6 @@ impl Decoder {
}
}
-
pub struct ChunkDecoder<'d, 'i> {
decoder: &'d mut Decoder,
input_chunk: &'i [u8],
@@ -62,6 +61,7 @@ pub struct ChunkDecoder<'d, 'i> {
}
impl<'d, 'i> ChunkDecoder<'d, 'i> {
... | 2 | 11 | 16 |
3905a46963d77abf656fe99cbb91f73091544f11 | Simon Sapin | 2015-10-02T11:08:22 | Store width in StrChar | diff --git a/lib.rs b/lib.rs
index 5478b3d..b17b286 100644
--- a/lib.rs
+++ b/lib.rs
@@ -152,7 +152,8 @@ impl<'d, 'i> ChunkDecoder<'d, 'i> {
sequence!().len = 0;
self.consume(position);
Some(DecodedPiece::AcrossChunks(StrChar {
- bytes: [sequence!().first, sequence!().second, seque... | 1 | 4 | 10 |
cbe0be8a9ae7fa32ed5120c3d50b8af0077c9dfe | Simon Sapin | 2015-10-02T10:47:41 | Make Decoder the main API. | diff --git a/lib.rs b/lib.rs
index 3ef7dfc..5478b3d 100644
--- a/lib.rs
+++ b/lib.rs
@@ -11,6 +11,14 @@ pub struct Decoder {
has_undecoded_input: bool,
}
+#[derive(Debug)]
+struct IncompleteSequence {
+ len: u8,
+ first: u8,
+ second: u8,
+ third: u8,
+}
+
impl Decoder {
pub fn new() -> Decode... | 2 | 195 | 243 |
82e7fd72f857458e0fe10e8eb535c43768c56a46 | Simon Sapin | 2015-10-02T10:01:45 | Drop the now-trivial PushLossyDecoder | diff --git a/lib.rs b/lib.rs
index ac42c90..3ef7dfc 100644
--- a/lib.rs
+++ b/lib.rs
@@ -6,42 +6,6 @@ use std::str;
/// The replacement character. In lossy decoding, insert it for every decoding error.
pub const REPLACEMENT_CHARACTER: &'static str = "\u{FFFD}";
-pub struct PushLossyDecoder<F: FnMut(&str)> {
- pu... | 2 | 10 | 44 |
73c84e8e5214655defcac54b51d52ae6887f454e | Simon Sapin | 2015-10-02T09:56:11 | Introduce a stateful decoder with iterators. | diff --git a/lib.rs b/lib.rs
index 252e6dd..ac42c90 100644
--- a/lib.rs
+++ b/lib.rs
@@ -8,7 +8,7 @@ pub const REPLACEMENT_CHARACTER: &'static str = "\u{FFFD}";
pub struct PushLossyDecoder<F: FnMut(&str)> {
push_str: F,
- incomplete_sequence: Option<IncompleteSequence>,
+ decoder: Decoder,
}
impl<F: F... | 3 | 179 | 71 |
e30b9305bb5aa8007dc0b29236ceecbdc797c894 | Simon Sapin | 2015-09-29T09:08:55 | Description and repository link | diff --git a/Cargo.toml b/Cargo.toml
index 0a97c84..870b8e8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,8 +2,9 @@
name = "utf8"
version = "0.1.0"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
-description = "Incremental UTF-8 decoding with error handling and no mandatory memory allocation."
+description = "Inc... | 1 | 2 | 1 |
d5192ce94eecd3c472a9bb4682bb766d5ec1c278 | Simon Sapin | 2015-09-29T07:12:06 | Add PushLossyDecoder | diff --git a/Cargo.toml b/Cargo.toml
index 4b557b4..0a97c84 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,3 +12,6 @@ doctest = false
[dependencies]
matches = "0.1.2"
+
+[profile.test]
+opt-level = 3
diff --git a/lib.rs b/lib.rs
index 8e7d006..252e6dd 100644
--- a/lib.rs
+++ b/lib.rs
@@ -6,6 +6,69 @@ use std::str;... | 5 | 121 | 26 |
846d3622cf11cebd1834d625e9bc5b296ee2ea4d | Simon Sapin | 2015-09-29T05:29:32 | Import tests from Rust. | diff --git a/Cargo.toml b/Cargo.toml
index 40fd9fd..4b557b4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,8 @@ license = "MIT / Apache-2.0"
[lib]
path = "lib.rs"
+test = false
+doctest = false
[dependencies]
matches = "0.1.2"
diff --git a/lib.rs b/lib.rs
index 0d7877d..8e7d006 100644
--- a/lib.rs
+++ b/li... | 4 | 160 | 66 |
d49d1ac215e75219c71867e1ce639eddbf6b6812 | Simon Sapin | 2015-09-28T22:58:58 | Add StrChar::to_char | diff --git a/lib.rs b/lib.rs
index 44bf7ca..0d7877d 100644
--- a/lib.rs
+++ b/lib.rs
@@ -255,6 +255,7 @@ pub enum CompleteResult<'a> {
}
/// Like `char`, but represented in memory as UTF-8
+#[derive(Copy, Clone)]
pub struct StrChar {
bytes: [u8; 4],
}
@@ -272,6 +273,12 @@ impl Deref for StrChar {
}
}
... | 1 | 7 | 0 |
67b8fcab6561bb66c95c97d2b158cdc1362cd4b2 | Simon Sapin | 2015-09-28T22:35:30 | Fix some lossy_to_string bugs
It was very wrong. | diff --git a/lib.rs b/lib.rs
index 874b52e..7ef934e 100644
--- a/lib.rs
+++ b/lib.rs
@@ -8,19 +8,30 @@ pub const REPLACEMENT_CHARACTER: &'static str = "\u{FFFD}";
pub fn lossy_to_string(input: &[u8]) -> Cow<str> {
// The first step is special: we want to return Cow::Borrowed if possible.
- let (s, mut status... | 1 | 19 | 8 |
0caf0d58b5b414a401b112d2e766f7eea69d2127 | Simon Sapin | 2015-09-28T20:24:48 | Use indexing rather than an iterator. | diff --git a/lib.rs b/lib.rs
index 272b585..874b52e 100644
--- a/lib.rs
+++ b/lib.rs
@@ -26,11 +26,11 @@ pub fn lossy_to_string(input: &[u8]) -> Cow<str> {
}
pub fn decode_step(input: &[u8]) -> (&str, DecodeStepStatus) {
- let mut iter = input.iter();
+ let mut position = 0;
loop {
- let first = m... | 1 | 19 | 21 |
e137f059c0cafa27d6bc62c2ce1ac82cb01c4ca2 | Simon Sapin | 2015-09-28T20:17:41 | Unroll the loop in IncompleteSequence::complete | diff --git a/lib.rs b/lib.rs
index 68fd63e..272b585 100644
--- a/lib.rs
+++ b/lib.rs
@@ -43,10 +43,10 @@ pub fn decode_step(input: &[u8]) -> (&str, DecodeStepStatus) {
// bytes need more examination.
if first >= 128 {
macro_rules! valid_prefix {
- ($incomplete_sequence_len:... | 1 | 82 | 57 |
51b4d7944e4b2f451e1865bf1e5c0e6b01e1341b | Simon Sapin | 2015-09-28T19:54:14 | Move decoded &str out of the result enum. | diff --git a/lib.rs b/lib.rs
index 6ef04d4..68fd63e 100644
--- a/lib.rs
+++ b/lib.rs
@@ -8,47 +8,36 @@ pub const REPLACEMENT_CHARACTER: &'static str = "\u{FFFD}";
pub fn lossy_to_string(input: &[u8]) -> Cow<str> {
// The first step is special: we want to return Cow::Borrowed if possible.
- let (mut string, m... | 1 | 37 | 39 |
73c1692d1554f2a8f4643a58a1565b7a8f65abfb | Simon Sapin | 2015-09-28T18:52:37 | Add lossy_to_string. | diff --git a/lib.rs b/lib.rs
index 670f870..6ef04d4 100644
--- a/lib.rs
+++ b/lib.rs
@@ -1,10 +1,44 @@
#[macro_use] extern crate matches;
+use std::borrow::Cow;
use std::ops::Deref;
use std::str;
pub const REPLACEMENT_CHARACTER: &'static str = "\u{FFFD}";
+pub fn lossy_to_string(input: &[u8]) -> Cow<str> {
+ ... | 1 | 34 | 0 |
2bfddbcd1debe072cd04f7a36566230890154529 | John Nunley | 2023-01-31T23:00:23 | Bump to 0.1.1 | diff --git a/Cargo.toml b/Cargo.toml
index 8d6e0a8..e516ad7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,12 +1,8 @@
[package]
name = "tinyvec_macros"
-version = "0.1.0"
+version = "0.1.1"
authors = ["Soveu <marx.tomasz@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0 OR Zlib"
repository = "https://git... | 1 | 1 | 5 |
f7da0c0278f423a2b81df363b7c60b570ef1479a | John Nunley | 2022-07-09T02:19:55 | Indicate that we forbid unsafe code
Makes this show up as clean on `cargo-geiger` | diff --git a/src/lib.rs b/src/lib.rs
index 4790e08..3c15b19 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,5 @@
#![no_std]
+#![forbid(unsafe_code)]
#[macro_export]
macro_rules! impl_mirrored { | 1 | 1 | 0 |
24f1c4e9c8b878c904c1673b0becb912f7d55518 | Soveu | 2020-08-09T16:30:13 | preparation for crates.io | diff --git a/Cargo.toml b/Cargo.toml
index 03a1c01..8d6e0a8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,6 +3,9 @@ name = "tinyvec_macros"
version = "0.1.0"
authors = ["Soveu <marx.tomasz@gmail.com>"]
edition = "2018"
+license = "MIT OR Apache-2.0 OR Zlib"
+repository = "https://github.com/Soveu/tinyvec_macros"
+d... | 2 | 5 | 0 |
9efc8cb2ebed8d8da78cbec90c1edbeacfc7378d | Steven Allen | 2024-08-15T20:04:16 | chore: release 0.1.6 | diff --git a/Cargo.toml b/Cargo.toml
index d25d0c6..791059d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "slug"
keywords = ["slugify", "slug", "id"]
-version = "0.1.5"
+version = "0.1.6"
authors = ["Steven Allen <steven@stebalien.com>"]
edition = "2021"
description = "Convert a unicod... | 1 | 1 | 1 |
13bcdedf31eb20f44dce76b1efb4e88370fcca61 | dmb-ish | 2024-08-15T20:03:47 | refactor: remove the only unsafe block (#9)
This does not result in any performance penalty, when running the
existing benchmarks. | diff --git a/src/lib.rs b/src/lib.rs
index e860d7d..5e2b3ac 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -30,7 +30,7 @@ pub fn slugify_owned(s: String) -> String {
// avoid unnecessary monomorphizations
fn _slugify(s: &str) -> String {
- let mut slug: Vec<u8> = Vec::with_capacity(s.len());
+ let mut slug = Str... | 1 | 8 | 10 |
2a8e2eb716498e8f302b43c46627f21437ffa669 | Steven Allen | 2023-11-06T15:23:25 | chore: release 0.1.5 | diff --git a/Cargo.toml b/Cargo.toml
index 1c98649..d25d0c6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "slug"
keywords = ["slugify", "slug", "id"]
-version = "0.1.4"
+version = "0.1.5"
authors = ["Steven Allen <steven@stebalien.com>"]
edition = "2021"
description = "Convert a unicod... | 1 | 2 | 2 |
60d7ee0ccf12e4f6d3fc54f2446bc0e3ba1c5e9d | Dustin Knopoff | 2022-11-29T13:00:20 | add support for web assembly | diff --git a/Cargo.toml b/Cargo.toml
index 5af7b46..1c98649 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@ name = "slug"
keywords = ["slugify", "slug", "id"]
version = "0.1.4"
authors = ["Steven Allen <steven@stebalien.com>"]
-
+edition = "2021"
description = "Convert a unicode string to a slug"
license ... | 3 | 24 | 6 |
b714326b24322005e05a59be54e54a682da634f8 | Igor Gnatenko | 2019-05-31T09:34:35 | chore: Update deunicode to 1 | diff --git a/Cargo.toml b/Cargo.toml
index e8228ce..5af7b46 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,4 +13,4 @@ homepage = "https://github.com/Stebalien/slug-rs"
documentation = "https://docs.rs/slug"
[dependencies]
-deunicode = "0.4.0"
+deunicode = "1" | 1 | 1 | 1 |
4ebc5cf3ce308644e84c9c6173f5096a103e3cc5 | Kornel | 2018-09-07T20:45:57 | Iterate ASCII bytes | diff --git a/src/lib.rs b/src/lib.rs
index 3b23100..646086c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -27,17 +27,17 @@ fn _slugify(s: &str) -> String {
// Starts with true to avoid leading -
let mut prev_is_dash = true;
{
- let mut push_char = |x: char| {
+ let mut push_char = |x: u8| {
... | 1 | 7 | 7 |
bc692e365e5d5261922ad03c69aecfb8400b1adc | Kornel | 2018-09-07T20:45:43 | Couple more test cases | diff --git a/benches/main.rs b/benches/main.rs
index ced48d8..1b45fe1 100644
--- a/benches/main.rs
+++ b/benches/main.rs
@@ -18,6 +18,8 @@ fn bench_slug_normal(b: &mut test::Bencher) {
use slug::slugify;
b.iter(|| {
test::black_box(slugify(test::black_box("My test Slug!!")));
+ test::black_box... | 1 | 3 | 0 |
1436a3b1f9362cb413bcee9ff86ef20840ed0916 | Steven Allen | 2018-09-07T16:49:47 | release 0.1.4 | diff --git a/Cargo.toml b/Cargo.toml
index 35b7450..e8228ce 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "slug"
keywords = ["slugify", "slug", "id"]
-version = "0.1.3"
+version = "0.1.4"
authors = ["Steven Allen <steven@stebalien.com>"]
description = "Convert a unicode string to a sl... | 1 | 1 | 1 |
1b6adc62fac1afa780b5515568c9b6d9970c1476 | Kornel | 2018-09-07T00:03:15 | Switch unidecode to deunicode crate | diff --git a/Cargo.toml b/Cargo.toml
index 8ced946..35b7450 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,4 +13,4 @@ homepage = "https://github.com/Stebalien/slug-rs"
documentation = "https://docs.rs/slug"
[dependencies]
-unidecode = "0.3"
+deunicode = "0.4.0"
diff --git a/src/lib.rs b/src/lib.rs
index 283da5c..3... | 2 | 4 | 4 |
6245b6ecd2250edaa36680cfa0255ff3384ed3f4 | Steven Allen | 2018-04-20T02:35:20 | bump to 0.1.3 | diff --git a/Cargo.toml b/Cargo.toml
index 083a0ec..8ced946 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "slug"
keywords = ["slugify", "slug", "id"]
-version = "0.1.2"
+version = "0.1.3"
authors = ["Steven Allen <steven@stebalien.com>"]
description = "Convert a unicode string to a sl... | 1 | 1 | 1 |
a626a683c984d127ea123ab6c33234cbebef116e | Steven Allen | 2018-04-20T02:33:44 | address clippy warnings | diff --git a/src/lib.rs b/src/lib.rs
index ee328d4..283da5c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,7 +18,7 @@ use unidecode::unidecode_char;
/// assert_eq!(slugify("user@example.com"), "user-example-com");
/// ```
pub fn slugify<S: AsRef<str>>(s: S) -> String {
- return _slugify(s.as_ref());
+ _slugif... | 1 | 3 | 3 |
25be8d538313b38d8ad3ca9c9d3764b30b4af1ee | Steven Allen | 2018-04-20T02:32:06 | avoid unecessary monomorphizations | diff --git a/src/lib.rs b/src/lib.rs
index c8aced5..ee328d4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,7 +18,11 @@ use unidecode::unidecode_char;
/// assert_eq!(slugify("user@example.com"), "user-example-com");
/// ```
pub fn slugify<S: AsRef<str>>(s: S) -> String {
- let s = s.as_ref();
+ return _slugify... | 1 | 5 | 1 |
e236e90b829cf934b11e86d744f7e356e65beff9 | Steven Allen | 2018-04-20T02:26:34 | update unidecode | diff --git a/Cargo.toml b/Cargo.toml
index f93e8c3..7ef7c24 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,4 +13,4 @@ homepage = "https://github.com/Stebalien/slug-rs"
documentation = "https://stebalien.github.io/slug-rs/slug"
[dependencies]
-unidecode = "0.2"
+unidecode = "0.3" | 1 | 1 | 1 |
e98f8050cf24ddf15d1258751ac7585ce2813ecf | Steven Allen | 2018-04-20T02:24:43 | fix warnings | diff --git a/src/lib.rs b/src/lib.rs
index 852cd53..c8aced5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,6 @@
extern crate unidecode;
use unidecode::unidecode_char;
-use std::ascii::AsciiExt;
/// Convert any unicode string to an ascii "slug" (useful for file names/url components)
///
@@ -29,13 +28,13 @@ ... | 1 | 3 | 4 |
2f3f7c7e23af0079ab5c89051e4aa3c999843dda | Steven Allen | 2016-09-08T17:48:49 | Release 0.1.2
* Remove special case for @ | diff --git a/Cargo.toml b/Cargo.toml
index e079a18..f93e8c3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "slug"
keywords = ["slugify", "slug", "id"]
-version = "0.1.1"
+version = "0.1.2"
authors = ["Steven Allen <steven@stebalien.com>"]
description = "Convert a unicode string to a sl... | 1 | 1 | 1 |
d5b2940fd70f8e985f4d969c25c1a5fee522ac32 | Steven Allen | 2015-09-01T17:01:26 | Fix unidecode version. | diff --git a/Cargo.toml b/Cargo.toml
index f2b2adf..e079a18 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "slug"
keywords = ["slugify", "slug", "id"]
-version = "0.1.0"
+version = "0.1.1"
authors = ["Steven Allen <steven@stebalien.com>"]
description = "Convert a unicode string to a sl... | 1 | 2 | 2 |
36e43c7af8e3954542eaea0185149b3099e99706 | Steven Allen | 2015-07-13T16:29:41 | Depend on upstream unidecode. | diff --git a/Cargo.toml b/Cargo.toml
index 711a61d..316771a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,6 +12,5 @@ repository = "https://github.com/Stebalien/slug-rs"
homepage = "https://github.com/Stebalien/slug-rs"
documentation = "https://stebalien.github.io/slug-rs/slug"
-[dependencies.unidecode]
-# TODO: u... | 1 | 2 | 3 |
90671dda51708639d5d0b7d5ee5eedd3c8856715 | Steven Allen | 2015-06-29T14:32:03 | Domain... | diff --git a/Cargo.toml b/Cargo.toml
index 722165e..711a61d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,4 +14,4 @@ documentation = "https://stebalien.github.io/slug-rs/slug"
[dependencies.unidecode]
# TODO: use upstream once they switch to a table (and provide unidecode_char).
-git = "https://gitbub.com/Stebali... | 1 | 1 | 1 |
489e4c6addb87d3e959936b56f78523e258e61f6 | Steven Allen | 2016-10-02T05:53:30 | add is_empty + clippy lints | diff --git a/benches/main.rs b/benches/main.rs
index 400d1f9..e3bdeed 100644
--- a/benches/main.rs
+++ b/benches/main.rs
@@ -3,7 +3,6 @@ extern crate test;
extern crate str_stack;
use str_stack::StrStack;
-use std::fmt::Write;
#[bench]
fn bench_index(b: &mut test::Bencher) {
diff --git a/src/lib.rs b/src/lib.rs... | 2 | 7 | 2 |
89c6ae487a18dc23d4fdf84a5ca4ca4b55397db2 | Steven Allen | 2015-11-14T21:27:30 | Get documentation ready | diff --git a/Cargo.toml b/Cargo.toml
index 3f80b86..b6aa568 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,14 @@
[package]
name = "str_stack"
-description = "a string allocator for allocating many write-once strings"
+description = """A string allocator for allocating many write-once strings.
+
+This library is ... | 1 | 10 | 1 |
804cf02f79a601b97f83a44d2645815aa7355a42 | Steven Allen | 2015-08-07T22:38:36 | module documentation. | diff --git a/src/lib.rs b/src/lib.rs
index b899547..22ded7d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,21 @@
+//! A string allocation library. This is primarily useful when you want to allocate a bunch of
+//! small strings, use them, and then destroy them all together.
+//!
+//! ## Example
+//!
+//! ```
+//! ... | 1 | 18 | 0 |
eee3edb9fb2c861250636589b1a741da35d5e89c | Steven Allen | 2015-08-07T22:29:15 | Benchmark. | diff --git a/benches/main.rs b/benches/main.rs
new file mode 100644
index 0000000..e3741a6
--- /dev/null
+++ b/benches/main.rs
@@ -0,0 +1,77 @@
+#![feature(test)]
+extern crate test;
+extern crate str_stack;
+
+use str_stack::StrStack;
+use std::fmt::Write;
+
+#[bench]
+fn bench_index(b: &mut test::Bencher) {
+ let ... | 1 | 77 | 0 |
144b0bcd2a691bc211da4bea54880d7b4c69e65b | Steven Allen | 2015-08-07T22:27:28 | Cleaner get | diff --git a/src/lib.rs b/src/lib.rs
index a84a644..b899547 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,7 +2,6 @@ use std::ops::Index;
use std::fmt::{self, Write};
use std::io::{self, Read};
use std::iter::FromIterator;
-use std::{slice, mem};
#[derive(Clone, Default)]
pub struct StrStack {
@@ -237,8 +236,8 @... | 1 | 2 | 3 |
788d9a296b1a2874c9485c51e4f2ea7ec74a58ae | Steven Allen | 2015-08-07T21:43:16 | Impl default | diff --git a/src/lib.rs b/src/lib.rs
index d79f746..a84a644 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,7 +4,7 @@ use std::io::{self, Read};
use std::iter::FromIterator;
use std::{slice, mem};
-#[derive(Clone)]
+#[derive(Clone, Default)]
pub struct StrStack {
data: String,
ends: Vec<usize>, | 1 | 1 | 1 |
11a57973f7ea39af8a8caa749b6c54c8ddb40c2d | Steven Allen | 2015-08-07T21:34:04 | Faster index
5x speedup. | diff --git a/src/lib.rs b/src/lib.rs
index 3d7ca71..d79f746 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,6 +2,7 @@ use std::ops::Index;
use std::fmt::{self, Write};
use std::io::{self, Read};
use std::iter::FromIterator;
+use std::{slice, mem};
#[derive(Clone)]
pub struct StrStack {
@@ -13,13 +14,10 @@ impl In... | 1 | 16 | 7 |
86f0a454cef30ec28992130ea8b1e085e2f245e7 | Steven Allen | 2015-08-07T21:33:57 | Add extend/fromiterator | diff --git a/src/lib.rs b/src/lib.rs
index d097d4a..3d7ca71 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,7 @@
use std::ops::Index;
use std::fmt::{self, Write};
use std::io::{self, Read};
+use std::iter::FromIterator;
#[derive(Clone)]
pub struct StrStack {
@@ -232,6 +233,25 @@ impl StrStack {
}
}
+... | 1 | 21 | 0 |
3fa7d24d2e83b4abd8be5a6fbd78bb28258d2c34 | Steven Allen | 2015-08-07T21:01:28 | Document and add consume method. | diff --git a/src/lib.rs b/src/lib.rs
index 8688d64..d097d4a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,6 @@
use std::ops::Index;
-use std::fmt;
-use std::fmt::Write;
+use std::fmt::{self, Write};
+use std::io::{self, Read};
#[derive(Clone)]
pub struct StrStack {
@@ -110,6 +110,8 @@ impl StrStack {
}
... | 1 | 70 | 2 |
691c860df89b5ff9ff88a5ccf835ed0441c10fc8 | Parker Timmerman | 2025-12-21T22:45:23 | feat: fixup the `utoipa` feature, update the trait impls and add an example (#445)
* start, update the trait impls and add an example
* fmt | diff --git a/Cargo.toml b/Cargo.toml
index bcee343a..e84ed36b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,7 @@ members = [
"examples/serde",
"examples/sqlx",
"examples/traits",
+ "examples/utoipa",
"fuzz",
]
exclude = ["compact_str"]
diff --git a/compact_str/Cargo.toml b/compact_str/Car... | 6 | 54 | 37 |
ebc5c6b4bfa4a3256ff54eeec857ba3636007527 | TeamDman | 2025-12-21T21:16:26 | feat: Add bevy-reflect feature (#439)
* feat: Add bevy-reflect feature
* feat: Add bevy example
* chore: Clean up bevy-reflect feature
* chore: Restore bevy-reflect feature example
* Fix bevy example workspace member
* Update to bevy-reflect 0.17.0-rc.2
* Add more tests ensuring derive macro functions as expecte... | diff --git a/Cargo.toml b/Cargo.toml
index 3952be3f..bcee343a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,7 @@
[workspace]
members = [
"bench",
+ "examples/bevy-reflect",
"examples/bytes",
"examples/diesel",
"examples/macros",
diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml... | 6 | 101 | 0 |
1485a7ac3d5220c459554f9aed74ee1828e5d811 | Robert Jansen | 2025-12-21T21:14:22 | fix sqlx type impl, add utoipa feature (#442)
* fix sqlx type impl, add utoipa feature
* do use default features
* format
* better sqlx definitions (fixes some array related issues)
* remove testing features
* actual fix
* oops
* better utoipa impl
* still implement ToSchema
* use str instead
* more utoipa f... | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index e0c7bd08..d21057da 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -32,6 +32,7 @@ sqlx-mysql = ["sqlx", "sqlx/mysql"]
sqlx-postgres = ["sqlx", "sqlx/postgres"]
sqlx-sqlite = ["sqlx", "sqlx/sqlite"]
zeroize = ["dep:zeroize"]
+utoip... | 4 | 107 | 12 |
db6e6e44e2fc443746d18ce565e3ad06b6110e2f | linkmauve | 2025-12-21T20:54:12 | feat: Expose core::error::Error without the std feature (#443)
Since Rust 1.81.0, the std::error::Error type is just a reexport from
core, so we can finally expose it even in no_std environments!
I’ve tested that everything builds against rustc 1.81.0. | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index 1f4663ce..e0c7bd08 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.9.0"
authors = ["Parker Timmerman <parker@parkertimmerman.com>"]
edition = "2021"
license = "MIT"
+rust-version = "1.81" # For core::erro... | 2 | 9 | 14 |
ee457971b1649afa1581c80ad3df9ceb56599973 | darkwater | 2025-09-23T20:22:37 | feat: Add support for defmt (#438) | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index 8d9ea804..1f4663ce 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -18,6 +18,7 @@ std = []
arbitrary = ["dep:arbitrary"]
borsh = ["dep:borsh"]
bytes = ["dep:bytes"]
+defmt = ["dep:defmt"]
diesel = ["dep:diesel"]
markup = ["dep:m... | 3 | 45 | 0 |
9bf30edeb67e7e7051ed1e8ca7b26ba3b8aeec5f | Parker Timmerman | 2025-02-25T03:51:33 | start, use v0.9.0 in examples (#431) | diff --git a/examples/bytes/Cargo.toml b/examples/bytes/Cargo.toml
index 734798a8..89f7ff83 100644
--- a/examples/bytes/Cargo.toml
+++ b/examples/bytes/Cargo.toml
@@ -7,4 +7,4 @@ edition = "2021"
[dependencies]
bytes = "1"
-compact_str = { version = "0.8.0-beta", features = ["bytes"] }
+compact_str = { version = "0... | 6 | 6 | 6 |
f1c0bc3eeb22c93df91e804984ea9acdee08928c | Parker Timmerman | 2025-02-25T02:55:01 | start, delete methods that are documented as being deleted in v0.9.0 (#429) | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 8db54c39..149530b5 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -211,26 +211,6 @@ impl CompactString {
CompactString(Repr::const_new(text))
}
- /// Creates a new inline [`CompactString`] at compile time.
- #[... | 1 | 0 | 20 |
2d7e3d4b9b8167956cab4327b92db4a44665de61 | Parker Timmerman | 2025-02-25T02:48:58 | start, small fix, qualify the vec macro (#428) | diff --git a/compact_str/src/features/borsh.rs b/compact_str/src/features/borsh.rs
index ccdf8d2e..2d078b5e 100644
--- a/compact_str/src/features/borsh.rs
+++ b/compact_str/src/features/borsh.rs
@@ -43,7 +43,7 @@ fn vec_from_reader<R: Read>(len: usize, reader: &mut R) -> Result<Vec<u8>> {
// less efficient (since ... | 1 | 1 | 1 |
be6b42a42305cf672ed6f70387dffdaa8a814cfa | Parker Timmerman | 2025-02-25T02:27:46 | feat: Add support for `zeroize::Zeroize` (#421)
* start, support the zeroize crate for data security
* implement a fn zeroize method on Repr that's derived from the zeroize crate
* add proptest and fuzz coverage for the new feature
* tweak the zeroize impl to match String
* cargo fmt | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index c5fbc975..64fb2a60 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -29,6 +29,7 @@ sqlx = ["dep:sqlx", "std"]
sqlx-mysql = ["sqlx", "sqlx/mysql"]
sqlx-postgres = ["sqlx", "sqlx/postgres"]
sqlx-sqlite = ["sqlx", "sqlx/sqlite"]
+zero... | 6 | 134 | 2 |
f41c016dfd61cfadc7246230b3c7ad0546b8354a | Parker Timmerman | 2024-12-29T22:23:47 | start, bump markup to 0.15 (#417) | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index c4c1fbc7..c5fbc975 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -35,7 +35,7 @@ arbitrary = { version = "1", optional = true, default-features = false }
borsh = { version = "1", optional = true }
bytes = { version = "1", optional... | 1 | 1 | 1 |
c9f31cdb0dce79700804eb0bbb1dc46e7a020763 | yhx-12243 | 2024-12-29T22:03:13 | Some slightly performance & style updates (#370)
* perf & style: needless slicing after c95edd5
* perf: is_heap is always false on 64-bit
* fix: pass clippy check
* fix: wrap the pointer in a black_box | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 8a99ff29..8db54c39 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -614,7 +614,7 @@ impl CompactString {
/// ```
#[inline]
pub fn as_bytes(&self) -> &[u8] {
- &self.0.as_slice()[..self.len()]
+ self.0.as_... | 3 | 10 | 3 |
0e48d4a5ece68263df3a968935316c36ca7b9f55 | ryota2357 | 2024-12-29T21:49:39 | fix: retain not set len if predicate panics (#413)
* test: add retain method test from alloc::String
https://github.com/rust-lang/rust/blob/73c278fd936c8eab4c8c6c6cb638da091b1e6740/library/alloc/tests/string.rs#L466-L499
* fix: retain not set len if predicate panics | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index d1f6a544..8a99ff29 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -1232,24 +1232,38 @@ impl CompactString {
pub fn retain(&mut self, mut predicate: impl FnMut(char) -> bool) {
// We iterate over the string, and copy ch... | 2 | 58 | 9 |
0e17e08a740d956bc9016e36db5aa034828681bb | Parker Timmerman | 2024-12-29T21:47:04 | bump version of diesel for RUSTSEC-2024-0365 (#416) | diff --git a/examples/diesel/Cargo.toml b/examples/diesel/Cargo.toml
index be6fb66f..4a99c555 100644
--- a/examples/diesel/Cargo.toml
+++ b/examples/diesel/Cargo.toml
@@ -5,5 +5,5 @@ edition = "2021"
[dependencies]
compact_str = { version = "0.8.0-beta", path = "../../compact_str", features = ["diesel"] }
-diesel =... | 1 | 1 | 1 |
39c782746b9b6832b7727accc3fa3d88fb136a35 | Parker Timmerman | 2024-12-29T21:31:23 | deps: upgrade to `rkyv v0.8` (#409)
* start, upgrade rkyv to v0.8
* upgrades rkyv to v0.8
* makes necessary changes to the impl
* update tests | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index 2d67d760..c4c1fbc7 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -38,7 +38,7 @@ diesel = { version = "2", optional = true, default-features = false }
markup = { version = "0.13", optional = true, default-features = false }
propte... | 2 | 28 | 22 |
bf0113afd0a8f8508975bea59fdec8dd4e2de2b0 | Parker Timmerman | 2024-08-20T02:26:32 | update public docs for CompactString::from_utf8_unchecked | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 71b2d9dc..0b8ace66 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -384,10 +384,12 @@ impl CompactString {
///
/// # Safety
///
- /// This function is unsafe because it does not check that the bytes passed to it are... | 2 | 8 | 5 |
91141e5140ed5697b4afc346e6f34e230d4ec084 | overlookmotel | 2024-08-20T02:16:59 | Remove invalid UTF8 check from `Repr::from_utf8_unchecked` (#379)
* Remove invalid UTF8 check from `Repr::from_utf8_unchecked`
* Fix proptest | diff --git a/compact_str/src/repr/mod.rs b/compact_str/src/repr/mod.rs
index 18a96f5a..d74c6790 100644
--- a/compact_str/src/repr/mod.rs
+++ b/compact_str/src/repr/mod.rs
@@ -123,19 +123,6 @@ impl Repr {
// Create a Repr with enough capacity for the entire buffer
let mut repr = Repr::with_capacity(byt... | 2 | 5 | 18 |
1336aa55f55be4516a74f78037c71d11387c77d4 | Imbolc | 2024-08-20T02:13:16 | impl PgHasArrayType (#399) | diff --git a/compact_str/src/features/sqlx.rs b/compact_str/src/features/sqlx.rs
index 041f0806..3e37b2ca 100644
--- a/compact_str/src/features/sqlx.rs
+++ b/compact_str/src/features/sqlx.rs
@@ -87,6 +87,14 @@ impl<'q> Encode<'q, sqlx::Postgres> for CompactString {
}
}
+#[cfg(feature = "sqlx-postgres")]
+#[cfg_... | 1 | 8 | 0 |
aceb3c0c22a159a8a8bc5a484148d3fccf43dff1 | Stepan Koltsov | 2024-08-20T02:11:16 | pub(crate) private code (#400)
When reading sources, make it more obvious what is public API, and
what is internals.
Also `pub(crate)` prevents exposing internals accidentally. | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 43046691..71b2d9dc 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -12,7 +12,7 @@ extern crate alloc;
use alloc::borrow::Cow;
use alloc::boxed::Box;
use alloc::string::String;
-#[doc(hidden)]
+#[doc(hidden)] // Referenced in macro... | 11 | 76 | 74 |
0c9d2e760b4fe9f95520a0f71934a287218afa14 | Stepan Koltsov | 2024-08-20T02:10:41 | Document CompactString has niches (#401)
Add `assert_eq_size!` assertion. | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 579a4ad1..43046691 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -2686,3 +2686,4 @@ fn unwrap_with_msg_fail<E: fmt::Display>(error: E) -> ! {
}
static_assertions::assert_eq_size!(CompactString, String);
+static_assertions::asse... | 1 | 1 | 0 |
5c8b856ab3d4596feec508f332dfbb3cbe0fa13a | Parker Timmerman | 2024-07-09T03:12:56 | start, bump version to 0.8.0 (#398) | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index 2e9f0781..beed3998 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "compact_str"
description = "A memory efficient string type that transparently stores strings on the stack, when possible"
-version =... | 1 | 1 | 1 |
f08f3dcb0fa028a2746cc5c490bdd7d7e24452b7 | Parker Timmerman | 2024-07-09T02:52:41 | start, remove rustversion(since(1.60)) tag since the msrv is now 1.60 (#396) | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 2851ea22..579a4ad1 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -2212,7 +2212,6 @@ impl<'a> From<&'a CompactString> for Cow<'a, str> {
}
}
-#[rustversion::since(1.60)]
#[cfg(target_has_atomic = "ptr")]
impl From<CompactS... | 1 | 0 | 1 |
a286302c874a9ea33abde147d563777a74149862 | Parker Timmerman | 2024-07-09T02:33:32 | starT (#394) | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index 6e40670f..2e9f0781 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -43,10 +43,7 @@ serde = { version = "1", optional = true, default-features = false, features = [
smallvec = { version = "1", optional = true, features = ["union"] }
... | 2 | 3 | 12 |
881f506f2f6ddcba5303b3e9cd3217e588206dd8 | Semyon Panenkov | 2024-07-09T02:14:29 | Add `borsh` support (#393)
* Add `borsh` support
* Use `core` instead of `std`
* Add a test failing with UB
* Reimplement without unsafe
* Use `take` + `read_to_end`
Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix nits
* Prevent a potential DoS attack
---------
C... | diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml
index e6940d1d..6e40670f 100644
--- a/compact_str/Cargo.toml
+++ b/compact_str/Cargo.toml
@@ -16,6 +16,7 @@ default = ["std"]
std = []
arbitrary = ["dep:arbitrary"]
+borsh = ["dep:borsh"]
bytes = ["dep:bytes"]
diesel = ["dep:diesel"]
markup = ["dep:mar... | 3 | 128 | 0 |
9d78de58daee789cb7e4e0a9433aa27f007852af | Parker Timmerman | 2024-06-10T13:12:38 | api: Re-add `new_inline()` and `from_static_str()` as deprecated (#383)
* start
* update deprecation warning
* cargo fmt | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index c6819ed6..2851ea22 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -234,6 +234,26 @@ impl CompactString {
CompactString(Repr::const_new(text))
}
+ /// Creates a new inline [`CompactString`] at compile time.
+ #[... | 1 | 20 | 0 |
8bee76b1bc65017dc433c7c2a42eda474ec415cf | Parker Timmerman | 2024-06-08T19:01:36 | fix: More `PartialEq` impls (#381)
* start
* fix clippy
* some more impls | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 08244da4..c6819ed6 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -624,8 +624,7 @@ impl CompactString {
///
/// # Safety
/// * All Rust strings, including `CompactString`, must be valid UTF-8. The caller must
- ///... | 3 | 88 | 8 |
33f6ce9df3d1f4fe5070c095f3ead4a99b9b2f9c | Parker Timmerman | 2024-05-06T13:31:23 | remove ensure_read optimization for loongarch and riscv architectures with note to re-add | diff --git a/compact_str/src/repr/mod.rs b/compact_str/src/repr/mod.rs
index e0e46022..57f1a69c 100644
--- a/compact_str/src/repr/mod.rs
+++ b/compact_str/src/repr/mod.rs
@@ -788,6 +788,8 @@ impl Extend<String> for Repr {
#[inline(always)]
fn ensure_read(value: usize) -> usize {
// SAFETY: This assembly instruct... | 1 | 2 | 2 |
20c15209fab00150b929b53f42326ca96e543f01 | Parker Timmerman | 2024-02-21T19:47:56 | fix: Remove explicit import of FromIterator (#369)
* start
* fmt and clippy | diff --git a/compact_str/src/features/proptest.rs b/compact_str/src/features/proptest.rs
index d1cfd1fe..b19658a8 100644
--- a/compact_str/src/features/proptest.rs
+++ b/compact_str/src/features/proptest.rs
@@ -2,15 +2,9 @@
use alloc::string::String;
-use proptest::arbitrary::{
- Arbitrary,
- StrategyFor,
-}... | 4 | 5 | 16 |
118963f0fb41a64ffbf8c6db17c5875e8885292a | René Kijewski | 2024-01-09T16:31:29 | Minor code clean ups (#350)
* Dedup code
* Add missing `#[track_caller]`
* Add `try_new()`
* Call fallible methods in infallible methods | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index f2c4b2da..62401d45 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -209,7 +209,16 @@ impl CompactString {
#[inline]
#[track_caller]
pub fn new<T: AsRef<str>>(text: T) -> Self {
- CompactString(Repr::new(text.as_... | 1 | 18 | 6 |
68d42f59ecece016c2289c38b795d45686b58376 | René Kijewski | 2024-01-09T14:52:48 | Add `const_new()`; remove `new_inline()` and `from_static_str()` (#336)
* Rename `from_static_str()` into `const_new()`
* Remove `new_inline()` | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 846f9a3c..f2c4b2da 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -157,6 +157,8 @@ impl CompactString {
/// Creates a new [`CompactString`] from any type that implements `AsRef<str>`.
/// If the string is short enough, the... | 9 | 95 | 108 |
b00aa81c6fcf7956c5132f94b4a4ffba33ebc470 | overlookmotel | 2024-01-08T18:03:19 | Align InlineBuffer same as Repr (#358)
Fixes #353. | diff --git a/compact_str/src/repr/heap.rs b/compact_str/src/repr/heap.rs
index aa0f1bf9..e9feb8e9 100644
--- a/compact_str/src/repr/heap.rs
+++ b/compact_str/src/repr/heap.rs
@@ -39,6 +39,7 @@ pub struct HeapBuffer {
pub cap: Capacity,
}
static_assertions::assert_eq_size!(HeapBuffer, Repr);
+static_assertions::a... | 3 | 14 | 5 |
ff00c74c58961969518ea873da84ce7d61e423cc | Tyler Hawkes | 2023-10-28T02:02:17 | Add missing From impls that String has (#328) | diff --git a/compact_str/src/lib.rs b/compact_str/src/lib.rs
index 683a6677..846f9a3c 100644
--- a/compact_str/src/lib.rs
+++ b/compact_str/src/lib.rs
@@ -2146,6 +2146,99 @@ impl<'a> From<&'a CompactString> for Cow<'a, str> {
}
}
+#[rustversion::since(1.60)]
+#[cfg(target_has_atomic = "ptr")]
+impl From<Compact... | 2 | 186 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.