Fix clippy::derive_partial_eq_without_eq

This commit is contained in:
Sosthène Guédon 2022-10-30 14:20:47 +01:00 committed by Vincent Prouillet
parent 405dda6722
commit faf00d1047
15 changed files with 25 additions and 23 deletions

View File

@ -26,7 +26,7 @@ pub fn find_content_components<P: AsRef<Path>>(path: P) -> Vec<String> {
} }
/// Struct that contains all the information about the actual file /// Struct that contains all the information about the actual file
#[derive(Debug, Default, Clone, PartialEq)] #[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct FileInfo { pub struct FileInfo {
/// The full path to the .md file /// The full path to the .md file
pub path: PathBuf, pub path: PathBuf,

View File

@ -12,7 +12,7 @@ use utils::de::{fix_toml_dates, from_toml_datetime};
use crate::front_matter::split::RawFrontMatter; use crate::front_matter::split::RawFrontMatter;
/// The front matter of every page /// The front matter of every page
#[derive(Debug, Clone, PartialEq, Deserialize)] #[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
#[serde(default)] #[serde(default)]
pub struct PageFrontMatter { pub struct PageFrontMatter {
/// <title> of the page /// <title> of the page

View File

@ -11,7 +11,7 @@ use crate::SortBy;
static DEFAULT_PAGINATE_PATH: &str = "page"; static DEFAULT_PAGINATE_PATH: &str = "page";
/// The front matter of every section /// The front matter of every section
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default)] #[serde(default)]
pub struct SectionFrontMatter { pub struct SectionFrontMatter {
/// <title> of the page /// <title> of the page

View File

@ -33,7 +33,7 @@ static RFC3339_DATE: Lazy<Regex> = Lazy::new(|| {
static FOOTNOTES_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r#"<sup class="footnote-reference"><a href=\s*.*?>\s*.*?</a></sup>"#).unwrap()); static FOOTNOTES_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r#"<sup class="footnote-reference"><a href=\s*.*?>\s*.*?</a></sup>"#).unwrap());
#[derive(Clone, Debug, Default, PartialEq)] #[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Page { pub struct Page {
/// All info about the actual file /// All info about the actual file
pub file: FileInfo, pub file: FileInfo,

View File

@ -13,14 +13,14 @@ use crate::ser::{SectionSerMode, SerializingPage, SerializingSection};
use crate::taxonomies::{Taxonomy, TaxonomyTerm}; use crate::taxonomies::{Taxonomy, TaxonomyTerm};
use crate::Section; use crate::Section;
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq, Eq)]
enum PaginationRoot<'a> { enum PaginationRoot<'a> {
Section(&'a Section), Section(&'a Section),
Taxonomy(&'a Taxonomy, &'a TaxonomyTerm), Taxonomy(&'a Taxonomy, &'a TaxonomyTerm),
} }
/// A list of all the pages in the paginator with their index and links /// A list of all the pages in the paginator with their index and links
#[derive(Clone, Debug, PartialEq, Serialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct Pager<'a> { pub struct Pager<'a> {
/// The page number in the paginator (1-indexed) /// The page number in the paginator (1-indexed)
pub index: usize, pub index: usize,
@ -43,7 +43,7 @@ impl<'a> Pager<'a> {
} }
} }
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq, Eq)]
pub struct Paginator<'a> { pub struct Paginator<'a> {
/// All pages in the section/taxonomy /// All pages in the section/taxonomy
all_pages: Cow<'a, [PathBuf]>, all_pages: Cow<'a, [PathBuf]>,

View File

@ -17,7 +17,7 @@ use crate::ser::{SectionSerMode, SerializingSection};
use crate::utils::{find_related_assets, get_reading_analytics, has_anchor}; use crate::utils::{find_related_assets, get_reading_analytics, has_anchor};
// Default is used to create a default index section if there is no _index.md in the root content directory // Default is used to create a default index section if there is no _index.md in the root content directory
#[derive(Clone, Debug, Default, PartialEq)] #[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Section { pub struct Section {
/// All info about the actual file /// All info about the actual file
pub file: FileInfo, pub file: FileInfo,

View File

@ -8,13 +8,13 @@ use crate::{Page, Section};
use libs::tera::{Map, Value}; use libs::tera::{Map, Value};
use utils::table_of_contents::Heading; use utils::table_of_contents::Heading;
#[derive(Clone, Debug, PartialEq, Serialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct BackLink<'a> { pub struct BackLink<'a> {
pub permalink: &'a str, pub permalink: &'a str,
pub title: &'a Option<String>, pub title: &'a Option<String>,
} }
#[derive(Clone, Debug, PartialEq, Serialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct TranslatedContent<'a> { pub struct TranslatedContent<'a> {
pub lang: &'a str, pub lang: &'a str,
pub permalink: &'a str, pub permalink: &'a str,
@ -39,7 +39,7 @@ fn find_backlinks<'a>(relative_path: &str, library: &'a Library) -> Vec<BackLink
backlinks backlinks
} }
#[derive(Clone, Debug, PartialEq, Serialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct SerializingPage<'a> { pub struct SerializingPage<'a> {
relative_path: &'a str, relative_path: &'a str,
content: &'a str, content: &'a str,
@ -134,7 +134,7 @@ impl<'a> SerializingPage<'a> {
} }
} }
#[derive(Clone, Debug, PartialEq, Serialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct SerializingSection<'a> { pub struct SerializingSection<'a> {
relative_path: &'a str, relative_path: &'a str,
content: &'a str, content: &'a str,

View File

@ -16,7 +16,7 @@ use crate::{Page, SortBy};
use crate::sorting::sort_pages; use crate::sorting::sort_pages;
#[derive(Debug, Clone, PartialEq, Serialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct SerializedTaxonomyTerm<'a> { pub struct SerializedTaxonomyTerm<'a> {
name: &'a str, name: &'a str,
slug: &'a str, slug: &'a str,
@ -104,7 +104,9 @@ impl PartialEq for TaxonomyTerm {
} }
} }
#[derive(Debug, Clone, PartialEq, Serialize)] impl Eq for TaxonomyTerm {}
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct SerializedTaxonomy<'a> { pub struct SerializedTaxonomy<'a> {
kind: &'a TaxonomyConfig, kind: &'a TaxonomyConfig,
lang: &'a str, lang: &'a str,
@ -128,7 +130,7 @@ impl<'a> SerializedTaxonomy<'a> {
} }
} }
/// All different taxonomies we have and their content /// All different taxonomies we have and their content
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct Taxonomy { pub struct Taxonomy {
pub kind: TaxonomyConfig, pub kind: TaxonomyConfig,
pub lang: String, pub lang: String,
@ -256,7 +258,7 @@ impl Taxonomy {
} }
/// Only used while building the taxonomies /// Only used while building the taxonomies
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq, Eq)]
pub(crate) struct TaxonomyFound<'a> { pub(crate) struct TaxonomyFound<'a> {
pub lang: &'a str, pub lang: &'a str,
pub slug: String, pub slug: String,

View File

@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, Eq)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
pub enum SortBy { pub enum SortBy {
/// Most recent to oldest /// Most recent to oldest

View File

@ -10,7 +10,7 @@ use utils::templates::ShortcodeFileType;
pub const SHORTCODE_PLACEHOLDER: &str = "@@ZOLA_SC_PLACEHOLDER@@"; pub const SHORTCODE_PLACEHOLDER: &str = "@@ZOLA_SC_PLACEHOLDER@@";
#[derive(PartialEq, Debug)] #[derive(PartialEq, Debug, Eq)]
pub struct Shortcode { pub struct Shortcode {
pub(crate) name: String, pub(crate) name: String,
pub(crate) args: Value, pub(crate) args: Value,

View File

@ -10,7 +10,7 @@ use content::{Page, TaxonomyTerm};
use errors::Result; use errors::Result;
use utils::templates::render_template; use utils::templates::render_template;
#[derive(Debug, Clone, PartialEq, Serialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct SerializedFeedTaxonomyItem<'a> { pub struct SerializedFeedTaxonomyItem<'a> {
name: &'a str, name: &'a str,
slug: &'a str, slug: &'a str,

View File

@ -4,7 +4,7 @@ use std::collections::HashMap;
use errors::{anyhow, Result}; use errors::{anyhow, Result};
/// Result of a successful resolution of an internal link. /// Result of a successful resolution of an internal link.
#[derive(Debug, PartialEq, Clone)] #[derive(Debug, PartialEq, Eq, Clone)]
pub struct ResolvedInternalLink { pub struct ResolvedInternalLink {
/// Resolved link target, as absolute URL address. /// Resolved link target, as absolute URL address.
pub permalink: String, pub permalink: String,

View File

@ -1,7 +1,7 @@
use serde::Serialize; use serde::Serialize;
/// Populated while receiving events from the markdown parser /// Populated while receiving events from the markdown parser
#[derive(Debug, Default, PartialEq, Clone, Serialize)] #[derive(Debug, Default, PartialEq, Eq, Clone, Serialize)]
pub struct Heading { pub struct Heading {
pub level: u32, pub level: u32,
pub id: String, pub id: String,

View File

@ -15,7 +15,7 @@ macro_rules! render_default_tpl {
}}; }};
} }
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub enum ShortcodeFileType { pub enum ShortcodeFileType {
Markdown, Markdown,
Html, Html,

View File

@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
pub enum InsertAnchor { pub enum InsertAnchor {
Left, Left,