Skip to content

Commit

Permalink
Fix clippy::derive_partial_eq_without_eq
Browse files Browse the repository at this point in the history
  • Loading branch information
sgued authored and Keats committed Feb 16, 2023
1 parent 405dda6 commit faf00d1
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion components/content/src/file_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
#[derive(Debug, Default, Clone, PartialEq)]
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct FileInfo {
/// The full path to the .md file
pub path: PathBuf,
Expand Down
2 changes: 1 addition & 1 deletion components/content/src/front_matter/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use utils::de::{fix_toml_dates, from_toml_datetime};
use crate::front_matter::split::RawFrontMatter;

/// The front matter of every page
#[derive(Debug, Clone, PartialEq, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
#[serde(default)]
pub struct PageFrontMatter {
/// <title> of the page
Expand Down
2 changes: 1 addition & 1 deletion components/content/src/front_matter/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::SortBy;
static DEFAULT_PAGINATE_PATH: &str = "page";

/// The front matter of every section
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default)]
pub struct SectionFrontMatter {
/// <title> of the page
Expand Down
2 changes: 1 addition & 1 deletion components/content/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

#[derive(Clone, Debug, Default, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Page {
/// All info about the actual file
pub file: FileInfo,
Expand Down
6 changes: 3 additions & 3 deletions components/content/src/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ use crate::ser::{SectionSerMode, SerializingPage, SerializingSection};
use crate::taxonomies::{Taxonomy, TaxonomyTerm};
use crate::Section;

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
enum PaginationRoot<'a> {
Section(&'a Section),
Taxonomy(&'a Taxonomy, &'a TaxonomyTerm),
}

/// 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> {
/// The page number in the paginator (1-indexed)
pub index: usize,
Expand All @@ -43,7 +43,7 @@ impl<'a> Pager<'a> {
}
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Paginator<'a> {
/// All pages in the section/taxonomy
all_pages: Cow<'a, [PathBuf]>,
Expand Down
2 changes: 1 addition & 1 deletion components/content/src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::ser::{SectionSerMode, SerializingSection};
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
#[derive(Clone, Debug, Default, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Section {
/// All info about the actual file
pub file: FileInfo,
Expand Down
8 changes: 4 additions & 4 deletions components/content/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use crate::{Page, Section};
use libs::tera::{Map, Value};
use utils::table_of_contents::Heading;

#[derive(Clone, Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct BackLink<'a> {
pub permalink: &'a str,
pub title: &'a Option<String>,
}

#[derive(Clone, Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct TranslatedContent<'a> {
pub lang: &'a str,
pub permalink: &'a str,
Expand All @@ -39,7 +39,7 @@ fn find_backlinks<'a>(relative_path: &str, library: &'a Library) -> Vec<BackLink
backlinks
}

#[derive(Clone, Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct SerializingPage<'a> {
relative_path: &'a str,
content: &'a str,
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<'a> SerializingPage<'a> {
}
}

#[derive(Clone, Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct SerializingSection<'a> {
relative_path: &'a str,
content: &'a str,
Expand Down
10 changes: 6 additions & 4 deletions components/content/src/taxonomies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{Page, SortBy};

use crate::sorting::sort_pages;

#[derive(Debug, Clone, PartialEq, Serialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct SerializedTaxonomyTerm<'a> {
name: &'a str,
slug: &'a str,
Expand Down Expand Up @@ -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> {
kind: &'a TaxonomyConfig,
lang: &'a str,
Expand All @@ -128,7 +130,7 @@ impl<'a> SerializedTaxonomy<'a> {
}
}
/// All different taxonomies we have and their content
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Taxonomy {
pub kind: TaxonomyConfig,
pub lang: String,
Expand Down Expand Up @@ -256,7 +258,7 @@ impl Taxonomy {
}

/// Only used while building the taxonomies
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub(crate) struct TaxonomyFound<'a> {
pub lang: &'a str,
pub slug: String,
Expand Down
2 changes: 1 addition & 1 deletion components/content/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};

#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, Eq)]
#[serde(rename_all = "lowercase")]
pub enum SortBy {
/// Most recent to oldest
Expand Down
2 changes: 1 addition & 1 deletion components/markdown/src/shortcode/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use utils::templates::ShortcodeFileType;

pub const SHORTCODE_PLACEHOLDER: &str = "@@ZOLA_SC_PLACEHOLDER@@";

#[derive(PartialEq, Debug)]
#[derive(PartialEq, Debug, Eq)]
pub struct Shortcode {
pub(crate) name: String,
pub(crate) args: Value,
Expand Down
2 changes: 1 addition & 1 deletion components/site/src/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use content::{Page, TaxonomyTerm};
use errors::Result;
use utils::templates::render_template;

#[derive(Debug, Clone, PartialEq, Serialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct SerializedFeedTaxonomyItem<'a> {
name: &'a str,
slug: &'a str,
Expand Down
2 changes: 1 addition & 1 deletion components/utils/src/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::collections::HashMap;
use errors::{anyhow, Result};

/// Result of a successful resolution of an internal link.
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct ResolvedInternalLink {
/// Resolved link target, as absolute URL address.
pub permalink: String,
Expand Down
2 changes: 1 addition & 1 deletion components/utils/src/table_of_contents.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::Serialize;

/// 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 level: u32,
pub id: String,
Expand Down
2 changes: 1 addition & 1 deletion components/utils/src/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macro_rules! render_default_tpl {
}};
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ShortcodeFileType {
Markdown,
Html,
Expand Down
2 changes: 1 addition & 1 deletion components/utils/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};

#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum InsertAnchor {
Left,
Expand Down

0 comments on commit faf00d1

Please sign in to comment.