Skip to content

Commit

Permalink
chore(deps): bump idna from 0.5.0 to 1.0.2 (vectordotdev#1002)
Browse files Browse the repository at this point in the history
* chore(deps): bump idna from 0.5.0 to 1.0.2

Bumps [idna](https://github.com/servo/rust-url) from 0.5.0 to 1.0.2.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](servo/rust-url@v0.5.0...idna-v1.0.2)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* regenerate licenses

Signed-off-by: Jesse Szwedko <[email protected]>

* Fix tests

Signed-off-by: Jesse Szwedko <[email protected]>

* clippy

Signed-off-by: Jesse Szwedko <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Jesse Szwedko <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Szwedko <[email protected]>
  • Loading branch information
dependabot[bot] and jszwedko authored Nov 12, 2024
1 parent bb94284 commit db0311b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
12 changes: 1 addition & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ flate2 = { version = "1", default-features = false, features = ["default"], opti
hex = { version = "0.4", optional = true }
hmac = { version = "0.12", optional = true }
iana-time-zone = { version = "0.1", optional = true }
idna = { version = "0.5", optional = true }
idna = { version = "1.0", optional = true }
indexmap = { version = "2", default-features = false, features = ["std"], optional = true}
influxdb-line-protocol = { version = "2.0.0", optional = true }
indoc = {version = "2", optional = true }
Expand Down
6 changes: 3 additions & 3 deletions src/stdlib/decode_punycode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl FunctionExpression for DecodePunycodeFn {
if validate {
let (decoded, result) = idna::domain_to_unicode(&string);

result.map_err(|errors| format!("unable to decode punycode: {errors}"))?;
result.map_err(|_errors| "unable to decode punycode".to_string())?;
Ok(decoded.into())
} else {
let decoded = string
Expand Down Expand Up @@ -125,13 +125,13 @@ mod test {

bidi_error {
args: func_args![value: value!("xn--8hbb.xn--fiba.xn--8hbf.xn--eib.")],
want: Err("unable to decode punycode: Errors { check_bidi }"),
want: Err("unable to decode punycode"),
tdef: TypeDef::bytes().fallible(),
}

multiple_errors {
args: func_args![value: value!("dns1.webproxy.idc.csesvcgateway.xn--line-svcgateway-jp-mvm-ri-d060072.\\-1roslin.canva.cn.")],
want: Err("unable to decode punycode: Errors { punycode, check_bidi }"),
want: Err("unable to decode punycode"),
tdef: TypeDef::bytes().fallible(),
}

Expand Down
8 changes: 4 additions & 4 deletions src/stdlib/encode_punycode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl FunctionExpression for EncodePunycodeFn {

if validate {
let encoded = idna::domain_to_ascii(&string)
.map_err(|errors| format!("unable to encode to punycode: {errors}"))?;
.map_err(|_errors| "unable to encode to punycode".to_string())?;
Ok(encoded.into())
} else {
if string
Expand Down Expand Up @@ -155,19 +155,19 @@ mod test {

bidi_error {
args: func_args![value: value!("xn--8hbb.xn--fiba.xn--8hbf.xn--eib.")],
want: Err("unable to encode to punycode: Errors { check_bidi }"),
want: Err("unable to encode to punycode"),
tdef: TypeDef::bytes().fallible(),
}

multiple_errors {
args: func_args![value: value!("dns1.webproxy.idc.csesvcgateway.xn--line-svcgateway-jp-mvm-ri-d060072.\\-1roslin.canva.cn.")],
want: Err("unable to encode to punycode: Errors { punycode, check_bidi }"),
want: Err("unable to encode to punycode"),
tdef: TypeDef::bytes().fallible(),
}

bidi_error2 {
args: func_args![value: value!("wwes.ir.abadgostaran.ir.taakads.ir.farhadrahimy.ir.regk.ir.2qok.com.خرید-پستی.com.maskancto.com.phpars.com.eshelstore.ir.techtextile.ir.mrafiei.ir.hamtamotor.com.surfiran.ir.negar3d.com.tjketab.ir.3d4dl.ir.cabindooshsahand.com.mashtikebab.sbs.")],
want: Err("unable to encode to punycode: Errors { check_bidi }"),
want: Err("unable to encode to punycode"),
tdef: TypeDef::bytes().fallible(),
}

Expand Down

0 comments on commit db0311b

Please sign in to comment.