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 |
|---|---|---|---|---|---|---|---|
7bb41717fac46a574a848e42f6816b4c6c6ffb65 | Sergio Benitez | 2023-05-05T23:13:44 | Impl 'Partial{Eq,Ord}' between borrowed and owned. | diff --git a/src/owned.rs b/src/owned.rs
index 5608d7c..07e6ed7 100644
--- a/src/owned.rs
+++ b/src/owned.rs
@@ -6,7 +6,7 @@ use core::cmp::Ordering;
use core::hash::{Hash, Hasher};
use core::fmt;
-use crate::UncasedStr;
+use crate::{UncasedStr, AsUncased};
/// An uncased (case-insensitive, case-preserving), own... | 1 | 28 | 19 |
6fb840b010e549da8a3f8730a7d6d99b980500fe | Sergio Benitez | 2022-05-17T05:20:09 | New version: 0.9.7. | diff --git a/Cargo.toml b/Cargo.toml
index 65f2cfc..fb871b2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.9.6"
+version = "0.9.7"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 1 | 1 | 1 |
b5b490946b28a5b94336a172e03f2cb2532d705f | Nikhil Benesch | 2021-09-06T15:59:23 | Make 'UncasedStr::new()' 'const' on Rust 1.56+. | diff --git a/build.rs b/build.rs
index 9936968..e7cf991 100644
--- a/build.rs
+++ b/build.rs
@@ -2,4 +2,8 @@ fn main() {
if let Some(true) = version_check::is_feature_flaggable() {
println!("cargo:rustc-cfg=nightly");
}
+
+ if let Some(true) = version_check::is_min_version("1.56.0") {
+ pri... | 2 | 29 | 0 |
b654387f42a404a09504b0fc8321b116f4d22b51 | Sergio Benitez | 2021-04-07T21:24:09 | New version: 0.9.6. | diff --git a/Cargo.toml b/Cargo.toml
index b9eae39..65f2cfc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.9.5"
+version = "0.9.6"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 2 | 1 | 2 |
b7b21da93d50787b625a911a6ea1cb1df1043380 | Sergio Benitez | 2021-04-07T20:54:45 | Add 'is_empty()' method. | diff --git a/src/borrowed.rs b/src/borrowed.rs
index 662d9c0..b5f2f1c 100644
--- a/src/borrowed.rs
+++ b/src/borrowed.rs
@@ -70,6 +70,24 @@ impl UncasedStr {
self.as_str().len()
}
+ /// Returns `true` if `self` has a length of zero bytes.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// us... | 1 | 18 | 0 |
d4baacb1737470f518f0db0d47caa5e9d991383d | Sergio Benitez | 2021-03-02T20:18:23 | New version: 0.9.5. | diff --git a/Cargo.toml b/Cargo.toml
index 6e2c7a6..b9eae39 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.9.4"
+version = "0.9.5"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 1 | 1 | 1 |
87784d69b88f3ac7f4328100a4f4de09846ff9c9 | Matt Brubeck | 2021-03-02T16:28:07 | Update 'repr(C)' doc: refer to 'repr(transparent)'. | diff --git a/src/owned.rs b/src/owned.rs
index e7008a0..5608d7c 100644
--- a/src/owned.rs
+++ b/src/owned.rs
@@ -135,9 +135,9 @@ impl<'s> Uncased<'s> {
/// ```
#[inline(always)]
pub fn into_boxed_uncased(self) -> Box<UncasedStr> {
- // This is simply a `newtype`-like transformation. The `repr(C)` ... | 1 | 3 | 3 |
484ca81fbc22effdf531cc57926d7060f88251b5 | Sergio Benitez | 2021-03-02T20:14:34 | Add regression doctest for #2. | diff --git a/src/borrowed.rs b/src/borrowed.rs
index d522ca2..662d9c0 100644
--- a/src/borrowed.rs
+++ b/src/borrowed.rs
@@ -83,6 +83,13 @@ impl UncasedStr {
/// assert!(uncased_str.starts_with("MOO"));
/// assert!(uncased_str.starts_with("MOOO"));
/// assert!(!uncased_str.starts_with("boo"));
+ ///
+... | 1 | 7 | 0 |
b7c22ea6c0659a08855dfe74d2979b26a1ebd2d0 | Giacomo Stevanato | 2021-03-02T16:53:27 | Avoid unexpected panics in 'starts_with'.
Co-authored-by: Frank Steffahn <frank.steffahn@stu.uni-kiel.de> | diff --git a/src/borrowed.rs b/src/borrowed.rs
index 1ec5fc7..d522ca2 100644
--- a/src/borrowed.rs
+++ b/src/borrowed.rs
@@ -86,7 +86,10 @@ impl UncasedStr {
/// ```
#[inline(always)]
pub fn starts_with(&self, string: &str) -> bool {
- self.len() >= string.len() && self[..string.len()] == string
+... | 1 | 4 | 1 |
1240cb294338999f86eeb49ee729596b8dafa761 | Sergio Benitez | 2021-02-25T01:17:01 | New version: 0.9.4. | diff --git a/Cargo.toml b/Cargo.toml
index c274f71..6e2c7a6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.9.3"
+version = "0.9.4"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 1 | 1 | 1 |
e06d3e66ea997dbb5a55db3b4d9d0cdeebf44da1 | Sergio Benitez | 2021-02-25T01:13:30 | Document 'AsUncased' trait. | diff --git a/src/as_uncased.rs b/src/as_uncased.rs
index d316c19..d8a34e1 100644
--- a/src/as_uncased.rs
+++ b/src/as_uncased.rs
@@ -1,7 +1,19 @@
use crate::UncasedStr;
/// Helper trait to convert string-like references to `&UncasedStr`.
+///
+/// # Example
+///
+/// ```rust
+/// use uncased::AsUncased;
+///
+/// l... | 1 | 12 | 0 |
df3f067dd846bdb7aea209ef8725bfab75ddf2af | Sergio Benitez | 2021-02-25T01:10:27 | Add 'with-serde' support, 'Partial{Ord,Eq}' impls. | diff --git a/Cargo.toml b/Cargo.toml
index e631ec4..c274f71 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,12 +11,14 @@ keywords = ["ascii", "uncased", "case-preserving", "case-insensitive", "no_std"]
license = "MIT OR Apache-2.0"
categories = ["text-processing", "value-formatting", "no-std"]
-
[features]
defaul... | 6 | 203 | 81 |
300507a46a75bcacf2d4c0452091a3c4caaca631 | Sergio Benitez | 2020-10-10T21:32:27 | Add 'html_root_url' doc attribute. | diff --git a/src/lib.rs b/src/lib.rs
index e3890a7..f60bf4f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -38,7 +38,7 @@
//! ```
#![no_std]
-
+#![doc(html_root_url = "https://docs.rs/uncased/0.9.3")]
#![cfg_attr(nightly, feature(doc_cfg))]
#[cfg(feature = "alloc")] extern crate alloc; | 1 | 1 | 1 |
14f24b9099a6c56e38f48d12a88487356836c59a | Sergio Benitez | 2020-10-10T05:32:37 | New version: 0.9.3. | diff --git a/Cargo.toml b/Cargo.toml
index e9aa0c3..e631ec4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 1 | 1 | 1 |
c6ce5d4f2ae189ce0d42955afd8be426e9b25aff | Sergio Benitez | 2020-10-10T05:31:19 | Add 'len()', 'starts_with()', and 'into_owned()' methods. | diff --git a/src/borrowed.rs b/src/borrowed.rs
index cbcf709..f1574dc 100644
--- a/src/borrowed.rs
+++ b/src/borrowed.rs
@@ -2,8 +2,10 @@ use core::cmp::Ordering;
use core::hash::{Hash, Hasher};
use core::fmt;
-/// A cost-free reference to an uncased (case-preserving) ASCII string. This is
-/// typically created fr... | 2 | 68 | 3 |
94b69e2eeac70455ae5557afe3d2cb470915caa2 | Sergio Benitez | 2020-09-25T05:29:47 | New version: 0.9.2. | diff --git a/Cargo.toml b/Cargo.toml
index ef2877e..e9aa0c3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.9.1"
+version = "0.9.2"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 1 | 1 | 1 |
df93dcf4d4cb361517407ab7777a405ab9962564 | Sergio Benitez | 2020-09-25T05:29:29 | Add slice indexing operations. | diff --git a/src/borrowed.rs b/src/borrowed.rs
index d4fbc8d..cbcf709 100644
--- a/src/borrowed.rs
+++ b/src/borrowed.rs
@@ -75,6 +75,15 @@ impl UncasedStr {
}
}
+impl<I: core::slice::SliceIndex<str, Output=str>> core::ops::Index<I> for UncasedStr {
+ type Output = UncasedStr;
+
+ #[inline]
+ fn index(... | 2 | 15 | 0 |
db97f217931f9c99a645feee78fa891df96ef0b5 | Sergio Benitez | 2020-09-06T12:39:20 | New version: 0.9.1. | diff --git a/Cargo.toml b/Cargo.toml
index 9daefad..ef2877e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.9.0"
+version = "0.9.1"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 1 | 1 | 1 |
4cb4781d15b7a8334467d598b9489ecfbd06af30 | Sergio Benitez | 2020-09-06T12:39:02 | Add const 'Uncased' constructors. | diff --git a/src/owned.rs b/src/owned.rs
index 9f862ae..7fb7c36 100644
--- a/src/owned.rs
+++ b/src/owned.rs
@@ -33,6 +33,40 @@ impl<'s> Uncased<'s> {
Uncased { string: string.into() }
}
+ /// Creates a new `Uncased` string from a borrowed `string`.
+ ///
+ /// # Example
+ ///
+ /// ```ru... | 1 | 34 | 0 |
57d1804551fa8c907d569f25744042db25bc59f8 | Sergio Benitez | 2020-09-06T12:16:14 | New version: 0.9. | diff --git a/Cargo.toml b/Cargo.toml
index 80b8b8f..9daefad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uncased"
-version = "0.1.0"
+version = "0.9.0"
authors = ["Sergio Benitez <sb@sergio.bz>"]
edition = "2018"
description = "Case-preserving, ASCII case-insensitive, no_std string ty... | 1 | 1 | 1 |
d77ef9f27cc336719b2d839d09ee6635dd22f758 | Sergio Benitez | 2024-07-25T23:37:48 | New version: 0.9.5. | diff --git a/Cargo.toml b/Cargo.toml
index ee18207..a386f7d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.9.4"
+version = "0.9.5"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
f4284aff45d7e128aa5d9f3483ef5ec1cd575a75 | Sergio Benitez | 2024-07-25T23:17:50 | Add a cautionary note about feature detection.
Co-authored-by: Ralf Jung <post@ralfj.de> | diff --git a/src/channel.rs b/src/channel.rs
index f84c508..e36b274 100644
--- a/src/channel.rs
+++ b/src/channel.rs
@@ -81,6 +81,8 @@ impl Channel {
/// Returns `true` if this channel supports feature flags. In other words,
/// returns `true` if the channel is either `dev` or `nightly`.
///
+ /// **P... | 2 | 38 | 1 |
736b788c9c32c93b545cb084eac6f94f31f2872c | Sergio Benitez | 2021-12-29T08:40:10 | New version: 0.9.4. | diff --git a/Cargo.toml b/Cargo.toml
index f9c2a9e..ee18207 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.9.3"
+version = "0.9.4"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
32693c9ff94940ec15694e48bf8cb1417a36a228 | Sergio Benitez | 2021-12-29T08:29:08 | Add 'supports_feature()'. | diff --git a/src/lib.rs b/src/lib.rs
index 21cf7b5..6c16074 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,58 +6,68 @@
//!
//! # Examples
//!
-//! Set a `cfg` flag in `build.rs` if the running compiler was determined to be
-//! at least version `1.13.0`:
+//! * Set a `cfg` flag in `build.rs` if the running compiler ... | 1 | 101 | 39 |
e7f0ff4d91c140b142fce89ab73c6bf932fe7321 | Sergio Benitez | 2021-03-17T00:32:37 | Parse raw channel strings as well. | diff --git a/src/channel.rs b/src/channel.rs
index 2332a01..f84c508 100644
--- a/src/channel.rs
+++ b/src/channel.rs
@@ -54,11 +54,12 @@ impl Channel {
/// assert!(stable.is_stable());
/// ```
pub fn parse(version: &str) -> Option<Channel> {
- if version.contains("-dev") {
+ let version = v... | 1 | 4 | 3 |
2f9b700d82c653168657f7802857d658fc16e3bc | Sergio Benitez | 2021-03-16T17:32:09 | Simplify 'Version::to_mmp()'. | diff --git a/src/version.rs b/src/version.rs
index a37d8d6..2bc18aa 100644
--- a/src/version.rs
+++ b/src/version.rs
@@ -59,13 +59,13 @@ impl Version {
.nth(0)
.unwrap_or("")
.split('.')
- .map(|s| s.parse::<u16>().ok());
+ .map(|s| s.parse::<u16>());
... | 1 | 5 | 5 |
d0e8ad075a6ba931f2ee735813fd56a8c0c0f2ea | Sergio Benitez | 2021-03-16T17:31:17 | Add 'Date::from_ymd()', don't allocate in 'parse'. | diff --git a/src/date.rs b/src/date.rs
index 55d9b24..de0b2d0 100644
--- a/src/date.rs
+++ b/src/date.rs
@@ -25,14 +25,6 @@ impl Date {
.and_then(|date| Date::parse(&date))
}
- /// Return the original (YYYY, MM, DD).
- fn to_ymd(&self) -> (u16, u8, u8) {
- let y = self.0 >> 9;
- ... | 1 | 51 | 15 |
11875244ee2afacf47218e8f2e322a39d61dc5df | Sergio Benitez | 2021-03-16T08:02:20 | New version: 0.9.3. | diff --git a/Cargo.toml b/Cargo.toml
index 48e531b..eb4bc7b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
dba235292c912fe7a1cedb3b43c9d3bd1bc83f56 | Sergio Benitez | 2021-03-16T07:57:47 | Tidy verbose parsing, unify tests. | diff --git a/src/lib.rs b/src/lib.rs
index f5a58d1..6802738 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -95,25 +95,22 @@ fn version_and_date_from_rustc_version(s: &str) -> (Option<String>, Option<Strin
/// Parses (version, date) as available from rustc verbose version output.
fn version_and_date_from_rustc_verbose_... | 1 | 104 | 133 |
cb8592005c573e9946aad85fd475d66103cb77d0 | Josh Stone | 2021-03-08T18:01:42 | Parse version and date from '--verbose'.
The plain `rustc --version` string is not well structured, and in
particular the git commit info is not necessarily present when rustc is
built out of tree, such as in distro builds. Furthermore,
rust-lang/rust#79115 made it possible to have completely custom
information in a v... | diff --git a/src/lib.rs b/src/lib.rs
index 6df728e..f5a58d1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -93,13 +93,36 @@ fn version_and_date_from_rustc_version(s: &str) -> (Option<String>, Option<Strin
(version.map(|s| s.to_string()), date.map(|s| s.to_string()))
}
+/// Parses (version, date) as available from ... | 1 | 113 | 4 |
b5caeeb14f2e2aa22aed56cf3fac85f8e44e9daf | Sergio Benitez | 2020-05-24T04:24:30 | New version: 0.9.2. | diff --git a/Cargo.toml b/Cargo.toml
index 75d8d45..48e531b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.9.1"
+version = "0.9.2"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
d9bd8e4495f54b4c9763cdbf4841500f353e85da | Jacob Pratt | 2020-05-22T23:21:19 | Expose 'Version::to_mmp()', add 'Version::from_mmp()'.
Resolves #13. | diff --git a/src/version.rs b/src/version.rs
index 18eec8b..a37d8d6 100644
--- a/src/version.rs
+++ b/src/version.rs
@@ -5,13 +5,6 @@ use std::fmt;
pub struct Version(u64);
impl Version {
- fn to_mmp(&self) -> (u16, u16, u16) {
- let major = self.0 >> 32;
- let minor = (self.0 << 32) >> 48;
- ... | 1 | 80 | 32 |
4ef0226d68908ac0437e6eb584b7b981d7d9d439 | mibac138 | 2020-05-02T17:34:43 | Increase strictness of 'Version::parse()'.
Fixes #11. | diff --git a/src/version.rs b/src/version.rs
index a0738d9..18eec8b 100644
--- a/src/version.rs
+++ b/src/version.rs
@@ -1,7 +1,7 @@
use std::fmt;
/// Version number: `major.minor.patch`, ignoring release channel.
-#[derive(Debug, PartialEq, Eq, Copy, Clone, PartialOrd, Ord)]
+#[derive(PartialEq, Eq, Copy, Clone, P... | 1 | 60 | 30 |
2cd670b24696665eba7df4840eadb538c8ebae11 | Sergio Benitez | 2019-05-24T06:08:03 | New version: 0.9.1. | diff --git a/Cargo.toml b/Cargo.toml
index aaa7ce8..75d8d45 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.9.0"
+version = "0.9.1"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
2aecb2a3eb4ea0c30f1f13e98f1ab9fa1b4c8dee | Sergio Benitez | 2019-05-24T06:06:35 | Fix 'Display' impl for 'Date'. | diff --git a/src/date.rs b/src/date.rs
index 35dc17c..55d9b24 100644
--- a/src/date.rs
+++ b/src/date.rs
@@ -1,6 +1,7 @@
use std::fmt;
/// Release date including year, month, and day.
+// Internal storage is: y[31..9] | m[8..5] | d[5...0].
#[derive(Debug, PartialEq, Eq, Copy, Clone, PartialOrd, Ord)]
pub struct D... | 2 | 42 | 4 |
96a6d6ccbe33efa1536130f9b8dac356f1722fd2 | Peter Hall | 2019-02-24T18:26:39 | Fix doc typo: 'min_data' -> 'min_date'. | diff --git a/src/lib.rs b/src/lib.rs
index a062062..89ab24e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -110,7 +110,7 @@ fn get_version_and_date() -> Option<(Option<String>, Option<String>)> {
///
/// If the date cannot be retrieved or parsed, or if `min_date` could not be
/// parsed, returns `None`. Otherwise retur... | 1 | 1 | 1 |
f2d5df160f2c533852e45ddf6670906f3406a17b | Sergio Benitez | 2018-09-23T19:41:43 | New version: 0.1.5. | diff --git a/Cargo.toml b/Cargo.toml
index 212f95f..8b01f4e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.1.4"
+version = "0.1.5"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
96f94b7fc1b83463d0d834232344e2bec5b854a0 | Sergio Benitez | 2018-09-23T19:39:51 | Parse only the last line of 'rustc --version'.
Cargo sometimes emits a 'warning' line to 'stdout', breaking the
canonical 'rustc --version' output, and thus breaking the parser. This
commit ignores everything but the last line of output from the command,
circumventing this issue.
Resolves #4. | diff --git a/src/lib.rs b/src/lib.rs
index 439b57b..a062062 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -86,7 +86,8 @@ fn str_to_mmp(mmp: &str) -> Option<u64> {
/// Returns (version, date) as available.
fn version_and_date_from_rustc_version(s: &str) -> (Option<String>, Option<String>) {
- let mut components = s... | 1 | 13 | 4 |
2a5cb8c9000a37b461f53fd70dd824161f6c8e59 | Sergio Benitez | 2018-07-05T19:53:04 | New version: 0.1.4. | diff --git a/Cargo.toml b/Cargo.toml
index 8efba9e..212f95f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.1.3"
+version = "0.1.4"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
f85791d9c21d621963d8adcdf7cf8e7d55a4f3e5 | Sergio Benitez | 2018-07-05T19:51:26 | Fix Cargo.toml for new license. | diff --git a/Cargo.toml b/Cargo.toml
index 76d92dd..8efba9e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,6 @@ documentation = "https://docs.rs/version_check/"
repository = "https://github.com/SergioBenitez/version_check"
readme = "README.md"
keywords = ["version", "rustc", "minimum", "check"]
-license = "MIT"... | 1 | 1 | 1 |
2137cde91c61d2e1806dc5fc68e16c3e316598a0 | Sergio Benitez | 2017-07-10T22:20:13 | New version: 0.1.3. | diff --git a/Cargo.toml b/Cargo.toml
index faac11b..76d92dd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.1.2"
+version = "0.1.3"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
1a3e94e83bdd9abba6df5c51aa4d9d7f7ed8dc7f | Sergio Benitez | 2017-07-10T22:04:08 | Don't require dates to parse version strings.
Fixes #1. | diff --git a/src/lib.rs b/src/lib.rs
index c7d5ff1..439b57b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -72,32 +72,33 @@ fn str_to_mmp(mmp: &str) -> Option<u64> {
.filter_map(|s| s.parse::<u16>().ok())
.collect();
- if mmp.len() == 2 {
+ if mmp.is_empty() {
+ return None
+ }
+
+ w... | 1 | 85 | 24 |
76ca8f26c674a4438c5574a62c766a3b9f10fc43 | Sergio Benitez | 2017-06-03T00:30:19 | New version: 0.1.2. | diff --git a/Cargo.toml b/Cargo.toml
index b0793d8..faac11b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.1.1"
+version = "0.1.2"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
7f6df72efaeb36734050d6737f9a779d97b0e5bd | Sergio Benitez | 2017-06-03T00:29:48 | Add supports_features function. | diff --git a/src/lib.rs b/src/lib.rs
index 206afd5..c7d5ff1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -170,3 +170,16 @@ pub fn is_dev() -> Option<bool> {
get_version_and_date()
.map(|(actual_version_str, _)| actual_version_str.contains("dev"))
}
+
+/// Determines whether the running or installed `rustc... | 1 | 13 | 0 |
a4f89eb7c67065043705bcfe75c7f91d6acc2809 | Sergio Benitez | 2017-06-02T23:47:41 | New version: 0.1.1. | diff --git a/Cargo.toml b/Cargo.toml
index 0d478bc..b0793d8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "version_check"
-version = "0.1.0"
+version = "0.1.1"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Tiny crate to check the version of the installed/running rustc."
doc... | 1 | 1 | 1 |
57c86477a03ea0469d5ee604701148f9047e2f43 | Sergio Benitez | 2017-06-02T23:47:03 | Add is_dev function. Support X.Y versions. | diff --git a/src/lib.rs b/src/lib.rs
index 9279513..206afd5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -65,15 +65,17 @@ fn str_to_ymd(ymd: &str) -> Option<u32> {
// Convert a string with prefix major-minor-patch to a single u64 maintaining
// ordering. Assumes none of the components are > 1048576.
fn str_to_mmp(mmp... | 1 | 17 | 5 |
13c37d54f8caa61978b98638ca1629d31b925315 | Sergio Benitez | 2017-01-15T08:54:27 | Add all that info to publish. | diff --git a/Cargo.toml b/Cargo.toml
index 3e0d9f3..0d478bc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,12 @@
[package]
-name = "version-check"
+name = "version_check"
version = "0.1.0"
authors = ["Sergio Benitez <sb@sergio.bz>"]
+description = "Tiny crate to check the version of the installed/running rustc.... | 1 | 7 | 1 |
cf37d0a46791d8feb9ad7ad0a083291d9ef4a7b7 | Grzesiek11 | 2024-01-18T14:06:22 | Add 'CookieBuilder::removal()'.
Add a `removal()` method to `CookieBuilder`, a counterpart to
`Cookie::make_removal()`, analogous to `CookieBuilder::permanent()`,
counterpart to `Cookie::make_permanent()`. | diff --git a/src/builder.rs b/src/builder.rs
index 6c3a626..8d7e9d5 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -212,7 +212,7 @@ impl<'c> CookieBuilder<'c> {
}
/// Makes the cookie being built 'permanent' by extending its expiration and
- /// max age 20 years into the future.
+ /// max age 20 ... | 1 | 27 | 1 |
273e3970ca597017d973330514c98cb0aeaf97b8 | Finn Bear | 2023-03-23T20:21:01 | Add support for CHIPS 'partitioned' attribute. | diff --git a/src/builder.rs b/src/builder.rs
index 34505ac..6c3a626 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -185,6 +185,32 @@ impl<'c> CookieBuilder<'c> {
self
}
+ /// Sets the `partitioned` field in the cookie being built.
+ ///
+ /// **Note:** _Partitioned_ cookies require the `Se... | 3 | 132 | 5 |
e2d8ddebc8f4b029f63ca73e0c4532b250ad7d5d | Sergio Benitez | 2023-10-09T22:15:00 | Fix doc typos. | diff --git a/src/jar.rs b/src/jar.rs
index e675316..2995310 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -509,8 +509,8 @@ impl CookieJar {
/// prefixes the name of cookies with `prefix`. Any retrievals from the
/// child jar will be made from the parent jar.
///
- /// **Note:** Cookie prefixes are spec... | 2 | 9 | 9 |
d68d01127fa5221919c68970fa60d9475da7cc46 | Sergio Benitez | 2023-10-07T01:55:35 | Implement cookie prefixes via 'PrefixedJar'.
Closes #214. | diff --git a/src/jar.rs b/src/jar.rs
index 76d7ea8..e675316 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -5,6 +5,7 @@ use std::collections::HashSet;
#[cfg(any(feature = "signed", feature = "private"))] use crate::secure::Key;
use crate::delta::DeltaCookie;
+use crate::prefix::{Prefix, PrefixedJar};
use crate::Cooki... | 5 | 460 | 6 |
8a1ec74040595339d729396593fabff1ca1fd349 | Markus Gasser | 2023-09-22T13:28:07 | Implement Debug for Key | diff --git a/src/secure/key.rs b/src/secure/key.rs
index 9c2228e..8b62a93 100644
--- a/src/secure/key.rs
+++ b/src/secure/key.rs
@@ -28,6 +28,12 @@ impl PartialEq for Key {
}
}
+impl std::fmt::Debug for Key {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("Key"... | 1 | 13 | 0 |
89edddf7152c263c03bf19338a571a01f971cf34 | Sergio Benitez | 2023-09-20T02:40:29 | Revert b62b4e: strip quotes from cookie value.
Some applications expect quotes to be preserved in a cookie's value, as
indicated by the RFC and expected by Servo, while others expect quotes to be
trimmed, as implemented by libraries like Django and Express. This commit
reverts a previous commit that always trimmed quo... | diff --git a/src/lib.rs b/src/lib.rs
index 9bcef9d..6a4b0e8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -454,6 +454,9 @@ impl<'c> Cookie<'c> {
/// Returns the value of `self`.
///
+ /// Does not strip surrounding quotes. See [`Cookie::value_trimmed()`] for a
+ /// version that does.
+ ///
/// ... | 2 | 63 | 24 |
efa8d9c925819668695b8d73cff22fc56ac94602 | Sergio Benitez | 2023-01-23T00:40:48 | Replace deprecated `base64` method calls. | diff --git a/src/secure/mod.rs b/src/secure/mod.rs
index ca06688..d88f940 100644
--- a/src/secure/mod.rs
+++ b/src/secure/mod.rs
@@ -1,5 +1,18 @@
extern crate rand;
-extern crate base64;
+
+mod base64 {
+ use base64::{DecodeError, Engine, prelude::BASE64_STANDARD};
+
+ /// Encode `input` as the standard base64 w... | 1 | 14 | 1 |
2a700429384023b0be1f711c787530a8909407b2 | Sergio Benitez | 2023-01-22T23:54:55 | Update 'base64' to '0.21'. | diff --git a/Cargo.toml b/Cargo.toml
index f6565e5..d576fe9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ percent-encoding = { version = "2.0", optional = true }
aes-gcm = { version = "0.10.0", optional = true }
hmac = { version = "0.12.0", optional = true }
sha2 = { version = "0.10.0", optional = true ... | 1 | 1 | 1 |
4295db8671b6561b21d3c29ce26aa6d799dcf926 | Sergio Benitez | 2023-01-21T00:53:53 | Add 'Cookie::split_{parse,parse_encoded}()'.
These methods return an iterator over parse results of cookies in a
string.
Resolves #198.
Closes #156. | diff --git a/src/lib.rs b/src/lib.rs
index 5ebd7e3..4c7e7c4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -300,6 +300,7 @@ impl<'c> Cookie<'c> {
/// let c = Cookie::parse("foo=bar%20baz; HttpOnly").unwrap();
/// assert_eq!(c.name_value(), ("foo", "bar%20baz"));
/// assert_eq!(c.http_only(), Some(true));
+ ... | 1 | 181 | 0 |
1de015a3295d59a6e4c540d70b6eb7acb1671248 | Sergio Benitez | 2023-01-16T15:44:50 | Move 'indexes_of' to 'CookieStr::indexed()'. | diff --git a/src/lib.rs b/src/lib.rs
index eef9d4b..5ebd7e3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -110,8 +110,30 @@ enum CookieStr<'c> {
}
impl<'c> CookieStr<'c> {
+ /// Creates an indexed `CookieStr` that holds the start and end indices of
+ /// `needle` inside of `haystack`, if `needle` is a substring... | 2 | 30 | 29 |
87d0396db8ba7f5d5166a744385aae8e8c3ba957 | Sergio Benitez | 2023-01-16T15:18:29 | Preserve leading '.' prefix for 'Domain'.
A leading `.` in the `Domain` of a cookie was previously removed during
parsing. While this was correct behavior, as stipulated by the RFC, it
raised an incongruity with manually set `Domain`s (via `set_domain()`,
and `CookieBuilder::domain()`), which did not strip a leading `... | diff --git a/src/lib.rs b/src/lib.rs
index 392728e..eef9d4b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -501,6 +501,10 @@ impl<'c> Cookie<'c> {
/// Returns the `Domain` of the cookie if one was specified.
///
+ /// This does not consider whether the `Domain` is valid; validation is left
+ /// to highe... | 2 | 39 | 8 |
b6d154ba2745565dab3a29c110bb1d21c35f34a9 | David Pedersen | 2022-12-16T10:10:08 | Update 'base64' to '0.20'. | diff --git a/Cargo.toml b/Cargo.toml
index 7fa40ee..c9baa76 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ percent-encoding = { version = "2.0", optional = true }
aes-gcm = { version = "0.10.0", optional = true }
hmac = { version = "0.12.0", optional = true }
sha2 = { version = "0.10.0", optional = true ... | 1 | 1 | 1 |
c51aeec6b9a151754827fae14d91faedfe0b6a42 | Jakub Wieczorek | 2022-08-16T12:19:39 | Upgrade `aes-gcm` to 0.10. | diff --git a/Cargo.toml b/Cargo.toml
index 2b2859d..fb5ccbc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ time = { version = "0.3", default-features = false, features = ["std", "parsing"
percent-encoding = { version = "2.0", optional = true }
# dependencies for secure (private/signed) functionality
-ae... | 2 | 2 | 2 |
608cb0d344e38a6ccbd31c1569b254989d3e2639 | Sergio Benitez | 2022-09-26T01:55:20 | Percent-encode '(', ')', and ','.
Fixes #205. | diff --git a/src/lib.rs b/src/lib.rs
index 05dcb94..392728e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -92,8 +92,6 @@ use std::str::FromStr;
#[allow(unused_imports, deprecated)]
use std::ascii::AsciiExt;
-#[cfg(feature = "percent-encode")]
-use percent_encoding::{AsciiSet, percent_encode as encode};
use time::{Du... | 1 | 48 | 28 |
ba60a065ef18af3949966369e4448653c9d25a60 | Sergio Benitez | 2022-07-15T07:26:46 | Improve error handling for 'Key::try_from()'.
Introduces a custom error type, 'KeyError', instead of using a 'String'
as an error type. Also adds documentation alluding to the existence of
the 'TryFrom' implementation. | diff --git a/src/secure/key.rs b/src/secure/key.rs
index c370a90..9c2228e 100644
--- a/src/secure/key.rs
+++ b/src/secure/key.rs
@@ -1,4 +1,4 @@
-use core::convert::{TryFrom, TryInto};
+use std::convert::TryFrom;
const SIGNING_KEY_LEN: usize = 32;
const ENCRYPTION_KEY_LEN: usize = 32;
@@ -28,19 +28,6 @@ impl Partia... | 1 | 66 | 15 |
0ca701208867a9afde0a4ebee3641941393f0e59 | erhodes | 2022-07-14T20:10:19 | Implement 'TryFrom<&[u8]>' for 'Key'.
Reimplement 'From' as a function of 'TryFrom'. | diff --git a/src/secure/key.rs b/src/secure/key.rs
index 76c2c37..c370a90 100644
--- a/src/secure/key.rs
+++ b/src/secure/key.rs
@@ -1,3 +1,5 @@
+use core::convert::{TryFrom, TryInto};
+
const SIGNING_KEY_LEN: usize = 32;
const ENCRYPTION_KEY_LEN: usize = 32;
const COMBINED_KEY_LENGTH: usize = SIGNING_KEY_LEN + ENCR... | 1 | 27 | 7 |
8871b9add43177f2f5efc3be08c6f6dc2eb0a41c | Sergio Benitez | 2021-12-29T08:45:42 | Enable 'doc_cfg' only when supported.
Closes #177. | diff --git a/Cargo.toml b/Cargo.toml
index 8750543..2b2859d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -34,7 +34,7 @@ hkdf = { version = "0.12.0", optional = true }
subtle = { version = "2.3", optional = true }
[build-dependencies]
-version_check = "0.9"
+version_check = "0.9.4"
[package.metadata.docs.rs]
all-... | 2 | 2 | 2 |
cbd84ffb70a9eb9492452287b050eb4194b7bb2b | Sergio Benitez | 2021-08-18T17:53:09 | Reexport 'time' from crate root. | diff --git a/src/builder.rs b/src/builder.rs
index 927ce90..78d1219 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -14,10 +14,8 @@ use crate::{Cookie, SameSite, Expiration};
///
/// ```rust
/// # extern crate cookie;
-/// extern crate time;
-///
/// use cookie::Cookie;
-/// use time::Duration;
+/// use cookie:... | 3 | 12 | 29 |
5e616c353cc55a731643a47ce628f6bd4d06cd37 | Sergio Benitez | 2021-08-08T21:22:40 | Fix 'time' 0.3 update. | diff --git a/src/lib.rs b/src/lib.rs
index d84d979..0b32257 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -79,9 +79,6 @@
#![doc(html_root_url = "https://docs.rs/cookie/0.16")]
#![deny(missing_docs)]
-#[cfg(feature = "percent-encode")] extern crate percent_encoding;
-extern crate time;
-
mod builder;
mod parse;
mod... | 2 | 61 | 81 |
0a7453c6c8b97d0eaf8261011e43251a6ae6075b | Rune Tynan | 2021-08-05T19:17:29 | Initial update to 'time' 0.3. | diff --git a/Cargo.toml b/Cargo.toml
index f47ea96..6acd194 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ signed = ["hmac", "sha2", "base64", "rand", "subtle"]
key-expansion = ["sha2", "hkdf"]
[dependencies]
-time = { version = "0.2.11", default-features = false, features = ["std"] }
+time = { version ... | 5 | 73 | 37 |
13511f3c550dc3502ffc86e6e6a754b904d13dca | Sergio Benitez | 2021-07-14T21:17:44 | Check if index is a char boundary before split.
Fixes #178. | diff --git a/src/secure/signed.rs b/src/secure/signed.rs
index ee18428..61bbbb9 100644
--- a/src/secure/signed.rs
+++ b/src/secure/signed.rs
@@ -49,8 +49,8 @@ impl<J> SignedJar<J> {
/// verifies the signed value and returns it. If there's a problem, returns
/// an `Err` with a string describing the issue.
... | 1 | 12 | 2 |
0de451d9defefd0018a00b6001d2671ac2e33fdc | Sergio Benitez | 2021-07-06T19:53:01 | Use 'doc_cfg' only when building docs.
Resolves #177. | diff --git a/src/jar.rs b/src/jar.rs
index e1b0591..c089784 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -410,7 +410,7 @@ impl CookieJar {
/// assert!(jar.get("private").is_some());
/// ```
#[cfg(feature = "private")]
- #[cfg_attr(nightly, doc(cfg(feature = "private")))]
+ #[cfg_attr(all(nightly, do... | 5 | 12 | 12 |
14b053a609eb494a09020f31f327a71c0a525dec | Tony Arcieri | 2021-05-03T19:06:27 | Update RustCrypto dependencies.
Updates the following RustCrypto dependencies to the latest versions:
* `aes-gcm` to v0.9.0
* `hmac` to v0.11.0
* `hkdf` to v0.11.0 | diff --git a/Cargo.toml b/Cargo.toml
index 8dc337c..ea855b8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,12 +25,12 @@ time = { version = "0.2.11", default-features = false, features = ["std"] }
percent-encoding = { version = "2.0", optional = true }
# dependencies for secure (private/signed) functionality
-aes-g... | 2 | 5 | 5 |
4b035513234e844dbad64ce1491c4f03c1b75fe5 | Sergio Benitez | 2021-02-25T21:04:43 | Use new 'Expiration' enum for 'expires'.
This allows consumers of 'cookie' to distinguish between expirations set
to `None` (`Expiration::Session`), expirations set to `Some`
(`Expiration::DateTime`), or unset expirations (`None`). | diff --git a/src/builder.rs b/src/builder.rs
index ccec7b8..9a138c2 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -1,8 +1,6 @@
use std::borrow::Cow;
-use time::{Duration, OffsetDateTime};
-
-use crate::{Cookie, SameSite};
+use crate::{Cookie, SameSite, Expiration};
/// Structure that follows the builder pat... | 4 | 264 | 75 |
90bfcfad8f95e355d527abafd97d03c166e99ab8 | Sergio Benitez | 2021-02-25T19:56:13 | Fix cfg_attr'd doc formatting. | diff --git a/src/lib.rs b/src/lib.rs
index b3658ce..cd5f7a3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -351,8 +351,8 @@ impl<'c> Cookie<'c> {
/// let mut c = Cookie::build("key?", "value").secure(true).path("/").finish();
/// assert_eq!(&c.stripped().to_string(), "key?=value");
#[cfg_attr(feature = "per... | 1 | 6 | 6 |
35042e45150bdb84a94d81cf3167578b368250cd | Sergio Benitez | 2021-02-25T19:32:14 | Apply clippy suggestions. | diff --git a/src/delta.rs b/src/delta.rs
index b9abac2..3ef35fa 100644
--- a/src/delta.rs
+++ b/src/delta.rs
@@ -19,20 +19,14 @@ impl DeltaCookie {
/// Create a new `DeltaCookie` that is being added to a jar.
#[inline]
pub fn added(cookie: Cookie<'static>) -> DeltaCookie {
- DeltaCookie {
- ... | 5 | 8 | 18 |
d8e45fcf5c7a82ed85d7f1afc0964e074e4f08cb | Sergio Benitez | 2021-02-25T19:16:55 | Update 'rand' to '0.8'. | diff --git a/Cargo.toml b/Cargo.toml
index 8177c2b..024832b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ aes-gcm = { version = "0.8.0", optional = true }
hmac = { version = "0.10.0", optional = true }
sha2 = { version = "0.9.0", optional = true }
base64 = { version = "0.13", optional = true }
-rand = {... | 1 | 1 | 1 |
cff858231387d27bd0a3fc2dec8860846bcdc79b | Tony Arcieri | 2020-10-19T19:08:04 | Update RustCrypto dependencies.
Updates the following RustCrypto dependencies:
* `aes-gcm` to 0.8.0
* `hmac` to 0.10.0
* `hkdf` to 0.10.0 | diff --git a/Cargo.toml b/Cargo.toml
index 724118a..8177c2b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,12 +25,12 @@ time = { version = "0.2.11", default-features = false, features = ["std"] }
percent-encoding = { version = "2.0", optional = true }
# dependencies for secure (private/signed) functionality
-aes-g... | 1 | 3 | 3 |
1c3ca838543b60a4448d279dc4b903cc7a2bc22a | Sergio Benitez | 2020-10-20T09:36:50 | Implement constant time 'PartialEq' for 'Key'. | diff --git a/Cargo.toml b/Cargo.toml
index b07720f..724118a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,8 +16,8 @@ HTTP cookie parsing and cookie jar management. Supports signed and private
[features]
percent-encode = ["percent-encoding"]
secure = ["private", "signed", "key-expansion"]
-private = ["aes-gcm", "ba... | 2 | 11 | 2 |
96759448004cc9bdb76a58cfacee815da5617f8b | Sergio Benitez | 2020-10-14T12:18:17 | Split child jars by mutability. Add 'Cookie::make_removal()'.
This commit splits the 'CookieJar::private()' method into
'CookieJar::private()' and 'CookieJar::private_mut()', allowing for
immutable-only access to child jars. | diff --git a/src/jar.rs b/src/jar.rs
index cd5618c..2ae8835 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -1,7 +1,5 @@
use std::collections::HashSet;
-use time::{Duration, OffsetDateTime};
-
#[cfg(feature = "signed")] use crate::secure::SignedJar;
#[cfg(feature = "private")] use crate::secure::PrivateJar;
#[cfg(any... | 4 | 228 | 130 |
e009dfa2fb50aa8a9ce35acc3dbb156e29a3f605 | Sergio Benitez | 2020-10-14T07:35:23 | Add 'SignedJar::verify()' and 'PrivateJar::decrypt()'. | diff --git a/src/secure/private.rs b/src/secure/private.rs
index 1314bcd..4c1a3c2 100644
--- a/src/secure/private.rs
+++ b/src/secure/private.rs
@@ -55,6 +55,39 @@ impl<'a> PrivateJar<'a> {
.and_then(|s| String::from_utf8(s).map_err(|_| "bad unsealed utf8"))
}
+ /// Authenticates and decrypts `co... | 2 | 70 | 19 |
f3508789e2c045e952af720c1d6f2a434ebda644 | Paolo Barbolini | 2020-10-13T07:50:55 | Update 'base64' to '0.13'. | diff --git a/Cargo.toml b/Cargo.toml
index 2a4cda5..b07720f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ percent-encoding = { version = "2.0", optional = true }
aes-gcm = { version = "0.7.0", optional = true }
hmac = { version = "0.8.0", optional = true }
sha2 = { version = "0.9.0", optional = true }
-... | 1 | 1 | 1 |
fdc60d17a0c2b7272a2948488624b6432ac6f120 | Peter Wischer | 2020-09-30T06:46:58 | Update 'aes-gcm' to '0.7.0'. | diff --git a/Cargo.toml b/Cargo.toml
index dd47eef..2a4cda5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ time = { version = "0.2.11", default-features = false, features = ["std"] }
percent-encoding = { version = "2.0", optional = true }
# dependencies for secure (private/signed) functionality
-aes-gcm... | 1 | 1 | 1 |
c045b44a14c5032d91f052fce9aaabc628bebc03 | Sergio Benitez | 2020-10-01T03:35:00 | Revert "Make 'CookieJar' thread-safe."
This reverts commit 0d379c038dd4cea5266a31fbe40b4557bd05f9bb. | diff --git a/Cargo.toml b/Cargo.toml
index 4cdc0b7..dd47eef 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,6 @@ key-expansion = ["sha2", "hkdf"]
[dependencies]
time = { version = "0.2.11", default-features = false, features = ["std"] }
percent-encoding = { version = "2.0", optional = true }
-dashmap = "4.0.0-... | 8 | 186 | 337 |
71c2a2f653950be7efbd88ce6c27186834d5b3af | Sergio Benitez | 2020-08-31T08:49:40 | Remove 'Key::from_master'. Add 'Key::master()'.
This commit changes the internal representation of 'Key' to allow for
the master key to be retrieved as a slice using 'Key::master()'. | diff --git a/src/secure/key.rs b/src/secure/key.rs
index 3a3d6ab..2810f65 100644
--- a/src/secure/key.rs
+++ b/src/secure/key.rs
@@ -1,12 +1,12 @@
-const PRIVATE_KEY_LEN: usize = 32;
-const SIGNED_KEY_LEN: usize = 32;
-const COMBINED_KEY_LENGTH: usize = PRIVATE_KEY_LEN + SIGNED_KEY_LEN;
+const SIGNING_KEY_LEN: usize = ... | 3 | 41 | 56 |
3795f2e63dc82e37923f2fd36c6450ff63851af2 | Sergio Benitez | 2020-08-16T01:14:51 | Handle "abbreviated" dates like Chromium.
Resolves #162. | diff --git a/src/parse.rs b/src/parse.rs
index 4dd8430..8b76ebb 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -9,7 +9,7 @@ use std::ascii::AsciiExt;
#[cfg(feature = "percent-encode")]
use percent_encoding::percent_decode;
-use time::{Duration, OffsetDateTime, PrimitiveDateTime, UtcOffset};
+use time::{Duration, O... | 1 | 32 | 2 |
0d379c038dd4cea5266a31fbe40b4557bd05f9bb | Sergio Benitez | 2020-07-17T10:40:37 | Make 'CookieJar' thread-safe.
To enable this change, 'CookieJar' retrieval methods return a new
'CookieCrumb' type, a reference-counted pointer to a 'Cookie'.
This commit also adds an 'Eq' implementation for 'Cookie'.
Closes #145.
Resolves #101. | diff --git a/Cargo.toml b/Cargo.toml
index dd47eef..4cdc0b7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,6 +23,7 @@ key-expansion = ["sha2", "hkdf"]
[dependencies]
time = { version = "0.2.11", default-features = false, features = ["std"] }
percent-encoding = { version = "2.0", optional = true }
+dashmap = "4.0.0-... | 8 | 336 | 186 |
aa4654c66213a4b6a40a93b7573d770d35ebda3c | Sergio Benitez | 2020-07-22T22:38:35 | Move to 0.15.0-dev. | diff --git a/Cargo.toml b/Cargo.toml
index e0b1b1a..dd47eef 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "cookie"
-version = "0.14.1"
+version = "0.15.0-dev"
authors = ["Sergio Benitez <sb@sergio.bz>", "Alex Crichton <alex@alexcrichton.com>"]
edition = "2018"
license = "MIT OR Apache-2... | 1 | 1 | 1 |
2b005008fa7e6069049447db2acd4833f25c7f8e | Sergio Benitez | 2020-07-22T22:24:32 | Only enable 'doc_cfg' on nightly. | diff --git a/Cargo.toml b/Cargo.toml
index 0724aab..e0b1b1a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/SergioBenitez/cookie-rs"
documentation = "https://docs.rs/cookie"
readme = "README.md"
+build = "build.rs"
description = """
HTTP cooki... | 7 | 20 | 11 |
f7a781b329abf1da39606176ec2ac2022d213f93 | Tony Arcieri | 2020-06-22T14:30:53 | Update 'hkdf' from '0.9.0-alpha.0' to '0.9.0'. | diff --git a/Cargo.toml b/Cargo.toml
index 3075fe7..0724aab 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ hmac = { version = "0.8.0", optional = true }
sha2 = { version = "0.9.0", optional = true }
base64 = { version = "0.12.1", optional = true }
rand = { version = "0.7.3", optional = true }
-hkdf = { v... | 1 | 1 | 1 |
e6d64e2ea30e176bb4a864721be62523b5796b4c | Max Countryman | 2020-07-09T13:20:58 | Fix typo: 'interator' -> 'iterator'. | diff --git a/src/jar.rs b/src/jar.rs
index afb8cc8..44b0d42 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -13,7 +13,7 @@ use crate::Cookie;
///
/// A `CookieJar` provides storage for any number of cookies. Any changes made
/// to the jar are tracked; the changes can be retrieved via the
-/// [delta](#method.delta) met... | 1 | 1 | 1 |
7efcdd83b8ded99ea86a9d00ed72cd211323949b | Sergio Benitez | 2020-06-15T01:37:06 | Revamp configurable cookie display via 'Display'.
This removes the existing 'EncodedCookie' type. | diff --git a/src/lib.rs b/src/lib.rs
index 4b9344e..3f9d5df 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -99,7 +99,7 @@ use std::str::FromStr;
use std::ascii::AsciiExt;
#[cfg(feature = "percent-encode")]
-use percent_encoding::{AsciiSet, percent_encode};
+use percent_encoding::{AsciiSet, percent_encode as encode};
... | 1 | 106 | 26 |
f7f6e741521c866bf9b6c290b4389425b5c952e7 | Tony Arcieri | 2020-06-08T17:40:42 | Update RustCrypto dependencies.
In particular:
* Update 'aes-gcm' to 0.6.
* Update 'hmac' to 0.8.
* Update 'hkdf' to 0.9.0-alpha0.
* Update 'sha2' to 0.9. | diff --git a/Cargo.toml b/Cargo.toml
index 4a2670e..3075fe7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,12 +24,12 @@ time = { version = "0.2.11", default-features = false, features = ["std"] }
percent-encoding = { version = "2.0", optional = true }
# dependencies for secure (private/signed) functionality
-aes-g... | 3 | 11 | 11 |
5933366206a163e62a3d08840edffedef7ad73af | Sergio Benitez | 2020-06-05T22:21:17 | Add 'readme' and update 'license' in 'Cargo.toml'. | diff --git a/Cargo.toml b/Cargo.toml
index 6b1f5ea..f296082 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,9 +3,10 @@ name = "cookie"
version = "0.14.0"
authors = ["Sergio Benitez <sb@sergio.bz>", "Alex Crichton <alex@alexcrichton.com>"]
edition = "2018"
-license = "MIT/Apache-2.0"
+license = "MIT OR Apache-2.0"
re... | 1 | 2 | 1 |
8d35e58fb511a459c721337a0bf29172233bad84 | Sergio Benitez | 2020-06-05T21:56:40 | Specify a correct 'time' minimum version.
Closes #148. | diff --git a/Cargo.toml b/Cargo.toml
index b2874f5..6b1f5ea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,7 @@ signed = ["hmac", "sha2", "base64", "rand"]
key-expansion = ["sha2", "hkdf"]
[dependencies]
-time = { version = "0.2.6", default-features = false, features = ["std"] }
+time = { version = "0.2.11",... | 1 | 1 | 1 |
9b165d6fda6f707c9799c5d1794f782691ce6e4c | Sergio Benitez | 2020-05-29T08:29:56 | Update 'base64' to '0.12'. | diff --git a/Cargo.toml b/Cargo.toml
index 436f38a..b2874f5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,7 +26,7 @@ percent-encoding = { version = "2.0", optional = true }
aes-gcm = { version = "0.5.0", optional = true }
hmac = { version = "0.7.1", optional = true }
sha2 = { version = "0.8.2", optional = true }
-... | 1 | 1 | 1 |
451928eada489322e4c49f9c38dd2f8604e5ec50 | Sergio Benitez | 2020-05-29T07:22:36 | Remove use of deprecated 'time' items. | diff --git a/src/jar.rs b/src/jar.rs
index cb18ce7..afb8cc8 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -226,7 +226,7 @@ impl CookieJar {
if self.original_cookies.contains(cookie.name()) {
cookie.set_value("");
cookie.set_max_age(Duration::seconds(0));
- cookie.set_expires(... | 3 | 7 | 6 |
bba0ccae71a9499a020f11757f8395493abec981 | Sergio Benitez | 2020-05-28T23:47:54 | Remove superfluous import of 'std::mem::replace'. | diff --git a/src/jar.rs b/src/jar.rs
index 8686933..cb18ce7 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -1,5 +1,4 @@
use std::collections::HashSet;
-use std::mem::replace;
use time::{Duration, OffsetDateTime}; | 1 | 0 | 1 |
69ad64ffbb09d4acf6f75e0c1639e7ab3d3a4968 | Sergio Benitez | 2020-05-28T23:47:39 | Reintroduce 'Key::from_master()', albeit deprecated. | diff --git a/src/secure/key.rs b/src/secure/key.rs
index e71e87b..46f9a7a 100644
--- a/src/secure/key.rs
+++ b/src/secure/key.rs
@@ -98,6 +98,36 @@ impl Key {
Key::from(&both_keys)
}
+ /// Derives new signing/encryption keys from a master key.
+ ///
+ /// The master key must be at least 256-bit... | 1 | 30 | 0 |
4bf34e5cb6d96dfe21ef65b152505c9600d70f13 | Sergio Benitez | 2020-05-27T08:38:21 | Remove deprecated 'CookieJar::clear()' method. | diff --git a/src/jar.rs b/src/jar.rs
index dfccd2f..8686933 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -312,17 +312,6 @@ impl CookieJar {
self.delta_cookies.remove(cookie.name());
}
- /// Removes all cookies from this cookie jar.
- #[deprecated(since = "0.7.0", note = "calling this method may not... | 1 | 2 | 12 |
623ee27dd6f0d572adbda6c7aa9a13f0ac90f830 | Sergio Benitez | 2020-05-27T08:39:15 | Re-enable commented out test. | diff --git a/src/jar.rs b/src/jar.rs
index 0b4dc72..dfccd2f 100644
--- a/src/jar.rs
+++ b/src/jar.rs
@@ -536,37 +536,37 @@ mod test {
assert!(is_send(CookieJar::new()))
}
- // #[test]
- // #[cfg(all(feature = "signed", feature = "private"))]
- // fn iter() {
- // let key = ::Key::generat... | 1 | 31 | 31 |
3b8c648c845e05027aae4cf2a186ece8676e4c94 | Sergio Benitez | 2020-05-21T22:13:21 | Ignore failing test due to 'time' regression. | diff --git a/src/lib.rs b/src/lib.rs
index 3232d85..7fbc945 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1156,12 +1156,6 @@ mod tests {
assert_eq!(&cookie.to_string(),
"foo=bar; Expires=Wed, 21 Oct 2015 07:28:00 GMT");
- let expires = OffsetDateTime::unix_epoch() + Duration::max_va... | 1 | 10 | 6 |
b62b4ed0c79258e33e41259b9512cb2f706ee486 | Robert Snakard | 2020-02-13T04:20:51 | Strip quotes from cookie value if present.
RFC #6265 section 4.1.1 dictates that a cookie value can contain
surrounding double-quotes. This is commonly interpreted as meaning that
surrounding double-quotes are not semantically part of a cookie's value
and thus should be trimmed. This commit modifies the cookie parser
... | diff --git a/src/parse.rs b/src/parse.rs
index 886c7a6..c147503 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -102,6 +102,17 @@ fn name_val_decoded(
unreachable!("This function should never be called with 'percent-encode' disabled!")
}
+fn trim_quotes(s: &str) -> &str {
+ if s.len() < 2 {
+ return s... | 1 | 33 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.