From c2f10af46c24e251f94acf89718f2b7679696948 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= <linus@mullvad.net>
Date: Thu, 25 Jan 2024 10:31:26 +0100
Subject: [PATCH] Don't pin serialport to a fork. Use upgraded upstream

The fix we needed is now part of serialport 4.3.0.
Avoiding git commits is good in general
---
 test/Cargo.lock | 83 +++++++++++++++++++------------------------------
 test/Cargo.toml |  3 --
 2 files changed, 32 insertions(+), 54 deletions(-)

diff --git a/test/Cargo.lock b/test/Cargo.lock
index f71c833e3d9c..f48fec100d0e 100644
--- a/test/Cargo.lock
+++ b/test/Cargo.lock
@@ -2,27 +2,6 @@
 # It is not intended for manual editing.
 version = 3
 
-[[package]]
-name = "CoreFoundation-sys"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0e9889e6db118d49d88d84728d0e964d973a5680befb5f85f55141beea5c20b"
-dependencies = [
- "libc",
- "mach 0.1.2",
-]
-
-[[package]]
-name = "IOKit-sys"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99696c398cbaf669d2368076bdb3d627fb0ce51a26899d7c61228c5c0af3bf4a"
-dependencies = [
- "CoreFoundation-sys",
- "libc",
- "mach 0.1.2",
-]
-
 [[package]]
 name = "addr2line"
 version = "0.21.0"
@@ -1343,6 +1322,16 @@ dependencies = [
  "syn 1.0.109",
 ]
 
+[[package]]
+name = "io-kit-sys"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4769cb30e5dcf1710fc6730d3e94f78c47723a014a567de385e113c737394640"
+dependencies = [
+ "core-foundation-sys",
+ "mach2",
+]
+
 [[package]]
 name = "ioctl-sys"
 version = "0.6.0"
@@ -1597,19 +1586,10 @@ dependencies = [
 ]
 
 [[package]]
-name = "mach"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fd13ee2dd61cc82833ba05ade5a30bb3d63f7ced605ef827063c63078302de9"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "mach"
-version = "0.3.2"
+name = "mach2"
+version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa"
+checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709"
 dependencies = [
  "libc",
 ]
@@ -1804,17 +1784,6 @@ dependencies = [
  "memoffset 0.6.5",
 ]
 
-[[package]]
-name = "nix"
-version = "0.24.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069"
-dependencies = [
- "bitflags 1.3.2",
- "cfg-if",
- "libc",
-]
-
 [[package]]
 name = "nix"
 version = "0.25.1"
@@ -2763,16 +2732,19 @@ dependencies = [
 
 [[package]]
 name = "serialport"
-version = "4.2.0"
-source = "git+https://github.com/mullvad/serialport-rs?rev=1401c9d39e4a89685e3506a7160869b2c8e9ceb0#1401c9d39e4a89685e3506a7160869b2c8e9ceb0"
+version = "4.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f5a15d0be940df84846264b09b51b10b931fb2f275becb80934e3568a016828"
 dependencies = [
- "CoreFoundation-sys",
- "IOKit-sys",
- "bitflags 1.3.2",
+ "bitflags 2.4.0",
  "cfg-if",
- "mach 0.3.2",
- "nix 0.24.3",
+ "core-foundation-sys",
+ "io-kit-sys",
+ "mach2",
+ "nix 0.26.4",
  "regex",
+ "scopeguard",
+ "unescaper",
  "winapi",
 ]
 
@@ -3623,6 +3595,15 @@ version = "1.17.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
 
+[[package]]
+name = "unescaper"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0adf6ad32eb5b3cadff915f7b770faaac8f7ff0476633aa29eb0d9584d889d34"
+dependencies = [
+ "thiserror",
+]
+
 [[package]]
 name = "unicode-bidi"
 version = "0.3.13"
diff --git a/test/Cargo.toml b/test/Cargo.toml
index ea4dc37696e2..a6653530b5ce 100644
--- a/test/Cargo.toml
+++ b/test/Cargo.toml
@@ -19,9 +19,6 @@ rust_2018_idioms = "deny"
 [workspace.lints.clippy]
 unused_async = "deny"
 
-[patch.crates-io]
-serialport = { git = "https://github.com/mullvad/serialport-rs", rev = "1401c9d39e4a89685e3506a7160869b2c8e9ceb0" }
-
 [workspace.dependencies]
 futures = "0.3"
 tokio = { version = "1.8", features = ["macros", "rt", "process", "time", "fs", "io-util", "rt-multi-thread"] }