Commit graph

45 commits

Author SHA1 Message Date
3a74a358b8
Update copyright year
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-25 16:12:53 +01:00
0dcff8ed80
pkstrings: clippy
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-19 21:00:52 +01:00
b824fe6512
pkstrings: strings: slightly more elaborate algo to split on End of String chars
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-19 20:21:34 +01:00
891120c4e6
pkstrings: strings: fix String::from call
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 18:47:35 +01:00
15d5b09dcb
pkstrings: reuse vec we're already consuming in TryFrom<Vec<u8>>
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 18:47:15 +01:00
fc8786dae9
pkstrings: Remove From<u8> impl
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 18:45:44 +01:00
891f05c271
pkstrings: convert: change output format
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 18:41:14 +01:00
6e32a71c0e
pkstrings: Use converted PKString result in Display
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 16:14:50 +01:00
99043c9dd2
pkstrings: Don't consume PKString when converting to String
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 16:14:08 +01:00
d2df9f1097
pkstrings: with_capacity might not be correct here
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 15:42:21 +01:00
494f20cd22
pkstrings: impl StdError for Error
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 15:25:58 +01:00
88206d84d3
pkstrings: change write_fmt to write! like other places
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 15:25:45 +01:00
7fa4a2079a
pkstrings: Remove TryFrom<String> for PKString
To force the user to use .as_st so that it's more obvious that we don't
take the ownership of the String.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 15:25:12 +01:00
1a9c5e0060
pkstrings: rename strtohex to chrtohex
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 13:51:25 +01:00
31290b2bbc
pkstrings: new as_slice method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 13:34:59 +01:00
7817909a69
pkstrings: Add some module level doc
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 13:17:35 +01:00
0a3a455b31
pkstrings: Move conversion cost to String away from from creation time
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-15 13:16:50 +01:00
1796f08e58
pkstrings: Split Invalid errors
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 15:51:59 +01:00
d54e39dcf6
pkstrings: prefer String::from in example
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 15:46:42 +01:00
5900325086
pkstrings: Move PKString and tests in their own modules
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 15:44:51 +01:00
025828debc pkstrings: New strings example
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 01:49:35 +01:00
ca4c0154e5 edition 2021
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 01:49:35 +01:00
0c0799994d pkstrings: impl TryFrom<u8> for PKString
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 01:49:35 +01:00
19b0f3989e pkstrings: Allow consuming and converting to String
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 01:49:32 +01:00
a82d73122d
pkstrings: prevent addition from overflowing
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-14 00:20:30 +01:00
cc723f7684
pkstrings: impl fmt::Display for Error
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2021-11-13 21:45:30 +01:00
11e54ded8b
pkstrings: rustfmt in tests
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-06 01:28:01 +02:00
b5deb06f22 pkstrings: add minimal tests
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-06 01:26:22 +02:00
cb93e2fae0 pkstrings: Use ranges to reduce match pattern sizes
Thanks ekleog!

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-06 01:26:07 +02:00
8c06d00a19
pkstrings: convert STRTOHEX to const fn
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-06 00:24:21 +02:00
889595a742
pkstrings: convert HEXTOSTR to const fn
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-06 00:18:09 +02:00
ed9c806096
pkstrings: Remove uneeded assignation
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-06 00:17:34 +02:00
62a9e24b97
pkstrings: Utilize HashMap's FromIterator impl
Thanks phaazon!

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-06 00:05:09 +02:00
fedac8daf7
pkstrings: rustfmt
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-05 22:36:17 +02:00
0444350885
pkstrings: increase array size for 'index out of bounds'
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-07-05 18:22:44 +02:00
93d9994859
pkstrings: convert HEXTOSTR to Vec
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 18:30:15 +02:00
681813f53a
pkstrings: Derive Clone rather
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 18:01:40 +02:00
2785113553
pkstrings: rustfmt
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 17:31:45 +02:00
d3483cc373
pkstrings: Implement Clone
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 17:19:36 +02:00
19853cec29
pkstrings: implement TryFrom<&str> via TryFrom<String>
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 00:54:18 +02:00
0ecc19a2fc
Add LICENSE files
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 00:50:19 +02:00
9bcd27374f
pkstrings: convert example
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 00:47:43 +02:00
4cbb0c50fd
pkstrings: implement Display
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 00:47:33 +02:00
f906a69aaa
pkstring: implement TryFrom<String> and TryFrom<&str>
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-30 00:04:27 +02:00
be04cdcaa1
pkstring: naïve implementation
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-06-29 23:58:17 +02:00