From 3e1d0666e55bc64ba8252831d4d56472e7636318 Mon Sep 17 00:00:00 2001 From: Folyd Date: Sun, 17 Oct 2021 11:32:07 +0800 Subject: [PATCH] Use serde derive feature directly --- rust/Cargo.lock | 10 +++++++--- rust/Cargo.toml | 8 ++++---- rust/src/tasks/books.rs | 3 +-- rust/src/tasks/crates.rs | 2 +- rust/src/tasks/labels.rs | 3 +-- rust/src/tasks/lints.rs | 2 +- rust/src/tasks/rfcs.rs | 2 +- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 99073e9..f6da05c 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "adler32" version = "1.0.4" @@ -706,9 +708,9 @@ dependencies = [ [[package]] name = "minifier" -version = "0.0.36" +version = "0.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1152a0a768a747fd88f25b1d47d28b9450e11df8ebdcaadea4cc55d9c0e79673" +checksum = "5594542d20834f2b974f5e5fb8e0cf1c67a2119dcadc29ef5d93a081fb30cc08" dependencies = [ "macro-utils", ] @@ -1258,7 +1260,6 @@ dependencies = [ "select", "semver", "serde", - "serde_derive", "serde_json", "tar", "tokio", @@ -1339,6 +1340,9 @@ name = "serde" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +dependencies = [ + "serde_derive", +] [[package]] name = "serde_derive" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 02d446f..68d3b5c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -3,12 +3,12 @@ name = "rust-search-extension" version = "0.1.0" authors = ["Folyd "] edition = "2018" +publish = false [dependencies] -serde = "1.0.102" -serde_json = "1.0.41" -serde_derive = "1.0.102" -minifier = "0.0.36" +serde = { version = "1", features = ["derive"] } +serde_json = "1" +minifier = "0.0.41" unicode-segmentation = "1.6.0" futures = "0.3.1" tokio = { version = "0.2", features = ["macros", "time"] } diff --git a/rust/src/tasks/books.rs b/rust/src/tasks/books.rs index 609ca1d..2d68004 100644 --- a/rust/src/tasks/books.rs +++ b/rust/src/tasks/books.rs @@ -7,8 +7,7 @@ use select::document::Document; use select::node::Node; use select::predicate::{Class, Name}; use serde::ser::SerializeTuple; -use serde::{Serialize, Serializer}; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize, Serializer}; use tokio::runtime::Runtime; use crate::minify::Minifier; diff --git a/rust/src/tasks/crates.rs b/rust/src/tasks/crates.rs index 3de8a3e..119c20e 100644 --- a/rust/src/tasks/crates.rs +++ b/rust/src/tasks/crates.rs @@ -10,7 +10,7 @@ use libflate::gzip::Decoder; use rayon::prelude::*; use semver::Version; use serde::de::DeserializeOwned; -use serde_derive::Deserialize; +use serde::Deserialize; use tar::Archive; use crate::minify::Minifier; diff --git a/rust/src/tasks/labels.rs b/rust/src/tasks/labels.rs index 059601d..116325d 100644 --- a/rust/src/tasks/labels.rs +++ b/rust/src/tasks/labels.rs @@ -3,8 +3,7 @@ use std::path::Path; use argh::FromArgs; use serde::ser::SerializeTuple; -use serde::{Serialize, Serializer}; -use serde_derive::Deserialize; +use serde::{Deserialize, Serialize, Serializer}; use tokio::runtime::Runtime; use crate::tasks::Task; diff --git a/rust/src/tasks/lints.rs b/rust/src/tasks/lints.rs index 0b1efef..983b73e 100644 --- a/rust/src/tasks/lints.rs +++ b/rust/src/tasks/lints.rs @@ -4,7 +4,7 @@ use std::fs; use std::path::Path; use argh::FromArgs; -use serde_derive::Deserialize; +use serde::Deserialize; use tokio::runtime::Runtime; use crate::minify::Minifier; diff --git a/rust/src/tasks/rfcs.rs b/rust/src/tasks/rfcs.rs index 9572b3d..77a1842 100644 --- a/rust/src/tasks/rfcs.rs +++ b/rust/src/tasks/rfcs.rs @@ -3,7 +3,7 @@ use std::{fs, path::Path}; use super::Task; use argh::FromArgs; use rayon::slice::ParallelSliceMut; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; const INDEX_PATH: &str = "../extension/index/rfcs.js";