From 33aa0f80423d09d8bd8b9031dff0bdf7c7ca1e57 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Sat, 4 Feb 2023 19:31:25 +0100
Subject: [PATCH] RUST: Try to reduce dependency number + remove unused files

---
 src/rust/Cargo.lock                          | 114 -------------------
 src/rust/Cargo.toml                          |  19 ++--
 src/rust/getset/.github/actions-rs/grcov.yml |  10 --
 src/rust/getset/.github/workflows/audit.yml  |  21 ----
 src/rust/getset/.github/workflows/test.yml   |  72 ------------
 src/rust/lektor_db/Cargo.toml                |   3 +-
 6 files changed, 9 insertions(+), 230 deletions(-)
 delete mode 100644 src/rust/getset/.github/actions-rs/grcov.yml
 delete mode 100644 src/rust/getset/.github/workflows/audit.yml
 delete mode 100644 src/rust/getset/.github/workflows/test.yml

diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock
index 7bf91141..99abaa02 100644
--- a/src/rust/Cargo.lock
+++ b/src/rust/Cargo.lock
@@ -145,50 +145,6 @@ dependencies = [
  "parking_lot 0.12.1",
 ]
 
-[[package]]
-name = "async-executor"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b"
-dependencies = [
- "async-lock",
- "async-task",
- "concurrent-queue",
- "fastrand",
- "futures-lite",
- "slab",
-]
-
-[[package]]
-name = "async-io"
-version = "1.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794"
-dependencies = [
- "async-lock",
- "autocfg",
- "concurrent-queue",
- "futures-lite",
- "libc",
- "log",
- "parking",
- "polling",
- "slab",
- "socket2",
- "waker-fn",
- "windows-sys 0.42.0",
-]
-
-[[package]]
-name = "async-lock"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685"
-dependencies = [
- "event-listener",
- "futures-lite",
-]
-
 [[package]]
 name = "async-recursion"
 version = "1.0.2"
@@ -200,12 +156,6 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "async-task"
-version = "4.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524"
-
 [[package]]
 name = "async-trait"
 version = "0.1.64"
@@ -350,7 +300,6 @@ dependencies = [
  "clap_derive",
  "clap_lex",
  "once_cell",
- "strsim",
  "terminal_size",
 ]
 
@@ -485,15 +434,6 @@ dependencies = [
  "toml 0.7.1",
 ]
 
-[[package]]
-name = "concurrent-queue"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e"
-dependencies = [
- "crossbeam-utils",
-]
-
 [[package]]
 name = "const_panic"
 version = "0.2.7"
@@ -1132,21 +1072,6 @@ version = "0.3.26"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531"
 
-[[package]]
-name = "futures-lite"
-version = "1.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48"
-dependencies = [
- "fastrand",
- "futures-core",
- "futures-io",
- "memchr",
- "parking",
- "pin-project-lite",
- "waker-fn",
-]
-
 [[package]]
 name = "futures-macro"
 version = "0.3.26"
@@ -2377,12 +2302,6 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "parking"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
-
 [[package]]
 name = "parking_lot"
 version = "0.11.2"
@@ -2529,20 +2448,6 @@ dependencies = [
  "miniz_oxide",
 ]
 
-[[package]]
-name = "polling"
-version = "2.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6"
-dependencies = [
- "autocfg",
- "cfg-if",
- "libc",
- "log",
- "wepoll-ffi",
- "windows-sys 0.42.0",
-]
-
 [[package]]
 name = "ppv-lite86"
 version = "0.2.17"
@@ -3571,12 +3476,6 @@ version = "0.9.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
 
-[[package]]
-name = "waker-fn"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca"
-
 [[package]]
 name = "want"
 version = "0.3.0"
@@ -3782,15 +3681,6 @@ version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb"
 
-[[package]]
-name = "wepoll-ffi"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb"
-dependencies = [
- "cc",
-]
-
 [[package]]
 name = "wgpu"
 version = "0.14.2"
@@ -4177,11 +4067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "23eaeb1859a3cd5c5f780b101dfe626bf250a5f34873c3c0226d6d9f7a4d107c"
 dependencies = [
  "async-broadcast",
- "async-executor",
- "async-io",
- "async-lock",
  "async-recursion",
- "async-task",
  "async-trait",
  "byteorder",
  "derivative",
diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
index b3e94128..7e01aa20 100644
--- a/src/rust/Cargo.toml
+++ b/src/rust/Cargo.toml
@@ -28,21 +28,18 @@ version = "0.1.0"
 license = "MIT"
 
 [workspace.dependencies]
-libc = "0.2"
 lazy_static = "^1"
 thiserror = "^1"
 
+libc = { version = "0.2", default-features = false }
+
 # DBus interactions
-zbus = { version = "^3", default-features = false, features = [
-    "tokio",
-    "async-io",
-] }
+zbus = { version = "^3", default-features = false, features = ["tokio"] }
 
 # Data Structures
 hashbrown = { version = "^0.13", features = ["serde"] }
 smallvec = { version = "^1", default-features = false, features = [
     "serde",
-    "write",
     "union",
     "const_generics",
     "const_new",
@@ -53,7 +50,11 @@ serde_json = { version = "^1", default-features = false, features = [
     "std",
     "preserve_order",
 ] }
-toml = { version = "^0.7", features = ["preserve_order", "parse"] }
+toml = { version = "^0.7", default-features = false, features = [
+    "preserve_order",
+    "display",
+    "parse",
+] }
 serde = { version = "^1", default-features = false, features = [
     "std",
     "derive",
@@ -70,10 +71,8 @@ tokio = { version = "1", features = [
     "rt",
     "rt-multi-thread",
     "net",
-    "time",
     "macros",
     "sync",
-    "io-util",
 ] }
 
 # Arguments
@@ -82,8 +81,6 @@ clap = { version = "^4", default-features = false, features = [
     "help",
     "std",
     "wrap_help",
-    "suggestions",
-    "error-context",
     "derive",
 ] }
 
diff --git a/src/rust/getset/.github/actions-rs/grcov.yml b/src/rust/getset/.github/actions-rs/grcov.yml
deleted file mode 100644
index 581dfdd4..00000000
--- a/src/rust/getset/.github/actions-rs/grcov.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-branch: true
-ignore-not-existing: true
-llvm: true
-filter: covered
-output-type: lcov
-output-file: /tmp/lcov.info
-ignore:
-  - "/*"
-  - "C:/*"
-  - "../*"
\ No newline at end of file
diff --git a/src/rust/getset/.github/workflows/audit.yml b/src/rust/getset/.github/workflows/audit.yml
deleted file mode 100644
index 1fbe6239..00000000
--- a/src/rust/getset/.github/workflows/audit.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: audit
-
-on:
-  schedule:
-    - cron: '0 0 * * *'
-  push:
-
-jobs:
-  audit:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v1
-      - name: Cache target
-        id: cache-target
-        uses: actions/cache@v1
-        with:
-          path: target
-          key: ${{ runner.os }}-audit-target-${{ hashFiles('**/Cargo.toml') }}
-      - uses: actions-rs/audit-check@v1
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/src/rust/getset/.github/workflows/test.yml b/src/rust/getset/.github/workflows/test.yml
deleted file mode 100644
index 8c20e2c7..00000000
--- a/src/rust/getset/.github/workflows/test.yml
+++ /dev/null
@@ -1,72 +0,0 @@
-name: test
-
-on:
-  push:
-  pull_request:
-
-env:
-  RUSTFLAGS: "--deny=warnings"
-
-jobs:
-  test:
-    strategy:
-      matrix:
-        os: [macos-latest, windows-latest, ubuntu-latest]
-        rust: [stable, nightly]
-    runs-on: ${{ matrix.os }}
-    steps:
-    - uses: actions/checkout@v1
-    - name: Cache target
-      id: cache-target
-      uses: actions/cache@v1
-      with:
-        path: target
-        key: ${{ runner.os }}-${{ matrix.rust }}-test-target-${{ hashFiles('**/Cargo.toml') }}
-    - name: Install Rust toolchain
-      uses: actions-rs/toolchain@v1
-      with:
-        toolchain: ${{ matrix.rust }}
-    - name: Test
-      uses: actions-rs/cargo@v1
-      with:
-        command: test
-        args: -- --nocapture
-
-  clippy:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v1
-      - name: Cache target
-        id: cache-target
-        uses: actions/cache@v1
-        with:
-          path: target
-          key: ${{ runner.os }}-clippy-target-${{ hashFiles('**/Cargo.toml') }}
-      - name: Install Rust toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-      - run: rustup component add clippy
-      - uses: actions-rs/clippy-check@v1
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
-
-  format:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v1
-      - name: Cache target
-        id: cache-target
-        uses: actions/cache@v1
-        with:
-          path: target
-          key: ${{ runner.os }}-format-target-${{ hashFiles('**/Cargo.toml') }}
-      - name: Install Rust toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-      - run: rustup component add rustfmt
-      - uses: actions-rs/cargo@v1
-        with:
-          command: fmt
-          args: -- --check
diff --git a/src/rust/lektor_db/Cargo.toml b/src/rust/lektor_db/Cargo.toml
index 7d3d2557..dceba9b3 100644
--- a/src/rust/lektor_db/Cargo.toml
+++ b/src/rust/lektor_db/Cargo.toml
@@ -12,11 +12,10 @@ doctest = false
 serde.workspace = true
 thiserror.workspace = true
 
-smallstring = { path = "../smallstring" }
-
 diesel_migrations = "2"
 diesel = { version = "2", default-features = false, features = ["sqlite"] }
 
 commons = { path = "../commons" }
 kurisu_api = { path = "../kurisu_api" }
+smallstring = { path = "../smallstring" }
 lektor_c_compat = { path = "../lektor_c_compat" }
-- 
GitLab