-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
021dc7a
commit bd9f92f
Showing
66 changed files
with
796 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "iref-core" | ||
version = "3.1.4" | ||
edition = "2021" | ||
authors = ["Timothée Haudebourg <[email protected]>"] | ||
categories = ["web-programming", "internationalization"] | ||
keywords = ["iri", "uri", "url", "resource", "identifier"] | ||
description = "Uniform & Internationalized Resource Identifiers (URIs/IRIs), borrowed and owned." | ||
repository = "https://github.com/timothee-haudebourg/iref" | ||
documentation = "https://docs.rs/iref" | ||
license = "MIT/Apache-2.0" | ||
readme = "README.md" | ||
|
||
[features] | ||
default = [] | ||
serde = ["dep:serde"] | ||
data = ["dep:base64"] | ||
|
||
[dependencies] | ||
pct-str = "2.0" | ||
smallvec = "1.2" | ||
thiserror = "1.0.40" | ||
static-regular-grammar = "2.0" | ||
serde = { version = "1.0", optional = true } | ||
hashbrown = { version = "0.14.0", optional = true } | ||
base64 = { version = "0.22.1", optional = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Core type and traits for the `iref` library. | ||
|
||
[![CI](https://github.com/timothee-haudebourg/iref/workflows/CI/badge.svg)](https://github.com/timothee-haudebourg/iref/actions) | ||
[![Crate informations](https://img.shields.io/crates/v/iref.svg?style=flat-square)](https://crates.io/crates/iref) | ||
[![License](https://img.shields.io/crates/l/iref.svg?style=flat-square)](https://github.com/timothee-haudebourg/iref#license) | ||
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://docs.rs/iref) | ||
|
||
<!-- cargo-rdme start --> | ||
<!-- cargo-rdme end --> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,7 +280,12 @@ pub fn port(bytes: &[u8], i: usize) -> (bool, usize) { | |
/// `bytes` must end at the end of the authority. | ||
pub fn find_port(bytes: &[u8], mut i: usize) -> Option<Range<usize>> { | ||
'host: while i < bytes.len() { | ||
if bytes[i] == b':' { | ||
// IP-literal. | ||
if bytes[i] == b'[' { | ||
while i < bytes.len() && bytes[i] != b']' { | ||
i += 1 | ||
} | ||
} else if bytes[i] == b':' { | ||
let start = i + 1; | ||
|
||
while i < bytes.len() { | ||
|
@@ -546,6 +551,7 @@ mod tests { | |
("", Err(0)), | ||
("/foo:bar", Err(0)), | ||
("//user:[email protected]/", Ok("user:[email protected]")), | ||
("//[::]", Ok("[::]")), | ||
]; | ||
|
||
for (input, expected) in vectors { | ||
|
@@ -563,6 +569,7 @@ mod tests { | |
("example.org", (UserInfoOrHost::Host, 11)), | ||
("example.org:12", (UserInfoOrHost::Host, 11)), | ||
(":12", (UserInfoOrHost::Host, 0)), | ||
("[::]", (UserInfoOrHost::Host, 4)), | ||
]; | ||
|
||
for (input, expected) in vectors { | ||
|
@@ -635,6 +642,7 @@ mod tests { | |
("example.org", None), | ||
("user:[email protected]:12", Some("12")), | ||
("user:[email protected]", None), | ||
("[::]", None), | ||
]; | ||
|
||
for (input, expected) in vectors { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pub(crate) mod common; | ||
pub mod iri; | ||
pub mod uri; | ||
pub(crate) mod utils; | ||
|
||
pub use iri::{InvalidIri, Iri, IriBuf, IriError, IriRef, IriRefBuf}; | ||
pub use uri::{InvalidUri, Uri, UriBuf, UriError, UriRef, UriRefBuf}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.