Skip to content

Commit

Permalink
prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
UMR1352 committed Mar 26, 2024
1 parent 14c888c commit 7f1ad1a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@

### Patch

- Forked [l1h3r/did_url](https://github.com/l1h3r/did_url) and fixed a bug that made
valid DID URLs containing `%`-encoded characters unparsable.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "did_url_parser"
version = "0.2.0"
authors = ["IOTA Stiftung"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "A no_std parser for Decentralized Identifiers (DIDs)"
repository = "https://github.com/iotaledger/did_url"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**A parser for Decentralized Identifiers (DIDs)**

A fork of https://github.com/l1h3r/did_url
A fork of [l1h3r/did_url](https://github.com/l1h3r/did_url).

---

Expand Down
7 changes: 2 additions & 5 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ impl Core {
}

pub(crate) fn set_path(&mut self, buffer: &mut String, value: &str) {
let end: u32 = self
.query
.or(self.fragment)
.unwrap_or_else(|| buffer.len() as u32);
let end: u32 = self.query.or(self.fragment).unwrap_or(buffer.len() as u32);

let int: Int = Int::new(end, self.path + value.len() as u32);

Expand All @@ -111,7 +108,7 @@ impl Core {
self.query = Some(fragment);
self.fragment = Some(fragment + value.len() as u32 + 1);

buffer.insert_str(fragment as usize, "?");
buffer.insert(fragment as usize, '?');
buffer.insert_str(fragment as usize + 1, value);
}
(Some(query), Some(fragment), Some(value)) => {
Expand Down
4 changes: 2 additions & 2 deletions src/did.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl DID {
/// This is fast since the serialized value is stored in the [`DID`].
#[inline]
pub fn as_str(&self) -> &str {
&*self.data
&self.data
}

/// Consumes the [`DID`] and returns the serialization.
Expand Down Expand Up @@ -194,7 +194,7 @@ impl Eq for DID {}

impl PartialOrd for DID {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.as_str().partial_cmp(other.as_str())
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 7f1ad1a

Please sign in to comment.