Skip to content

Commit

Permalink
chore: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Jun 18, 2024
1 parent 07cb941 commit 30f042a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion frb_codegen/src/library/codegen/ir/hir/flat/component.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub(crate) trait HirFlatComponent<SK: Ord> {
pub(crate) trait HirFlatComponentTrait<SK: Ord> {
fn sort_key(&self) -> SK;
}
4 changes: 2 additions & 2 deletions frb_codegen/src/library/codegen/ir/hir/flat/function.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::codegen::ir::hir::flat::component::HirFlatComponent;
use crate::codegen::ir::hir::flat::component::HirFlatComponentTrait;
use crate::codegen::ir::hir::misc::generation_source::HirGenerationSource;
use crate::codegen::ir::hir::misc::item_fn::GeneralizedItemFn;
use crate::codegen::ir::hir::misc::serializers::serialize_generalized_item_fn;
Expand All @@ -18,7 +18,7 @@ pub(crate) struct HirFlatFunction {
pub(crate) item_fn: GeneralizedItemFn,
}

impl HirFlatComponent<SimpleOwnerAndName> for HirFlatFunction {
impl HirFlatComponentTrait<SimpleOwnerAndName> for HirFlatFunction {
fn sort_key(&self) -> SimpleOwnerAndName {
self.owner_and_name_for_dedup()
}
Expand Down
4 changes: 2 additions & 2 deletions frb_codegen/src/library/codegen/ir/hir/flat/pack.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::codegen::ir::hir::flat::component::HirFlatComponent;
use crate::codegen::ir::hir::flat::component::HirFlatComponentTrait;
use crate::codegen::ir::hir::flat::function::HirFlatFunction;
use crate::codegen::ir::hir::flat::struct_or_enum::{HirFlatEnum, HirFlatStruct};
use crate::codegen::ir::hir::flat::trait_impl::HirFlatTraitImpl;
Expand Down Expand Up @@ -30,5 +30,5 @@ impl HirFlatPack {
}

pub(crate) trait HirFlatPackComponentVisitor {
fn visit<SK: Ord, T: HirFlatComponent<SK>>(&self, items: &mut Vec<T>);
fn visit<SK: Ord, T: HirFlatComponentTrait<SK>>(&self, items: &mut Vec<T>);
}
4 changes: 2 additions & 2 deletions frb_codegen/src/library/codegen/ir/hir/flat/struct_or_enum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::codegen::ir::hir::flat::component::HirFlatComponent;
use crate::codegen::ir::hir::flat::component::HirFlatComponentTrait;
use crate::codegen::ir::hir::misc::generation_source::HirGenerationSource;
use crate::codegen::ir::hir::misc::syn_item_struct_or_enum::SynItemStructOrEnum;
use crate::codegen::ir::hir::misc::visibility::HirVisibility;
Expand All @@ -22,7 +22,7 @@ pub struct HirFlatStructOrEnum<Item: SynItemStructOrEnum> {
}
// frb-coverage:ignore-end

impl<Item: SynItemStructOrEnum> HirFlatComponent<NamespacedName> for HirFlatStructOrEnum<Item> {
impl<Item: SynItemStructOrEnum> HirFlatComponentTrait<NamespacedName> for HirFlatStructOrEnum<Item> {
fn sort_key(&self) -> NamespacedName {
self.name.clone()
}
Expand Down
4 changes: 2 additions & 2 deletions frb_codegen/src/library/codegen/ir/hir/flat/trait_impl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::codegen::ir::hir::flat::component::HirFlatComponent;
use crate::codegen::ir::hir::flat::component::HirFlatComponentTrait;
use crate::codegen::ir::hir::misc::serializers::serialize_syn;

#[derive(Clone, serde::Serialize, Debug)]
Expand All @@ -8,7 +8,7 @@ pub struct HirFlatTraitImpl {
pub(crate) impl_ty: syn::Type,
}

impl HirFlatComponent<String> for HirFlatTraitImpl {
impl HirFlatComponentTrait<String> for HirFlatTraitImpl {
fn sort_key(&self) -> String {
self.trait_name.clone()
}
Expand Down
4 changes: 2 additions & 2 deletions frb_codegen/src/library/codegen/ir/hir/flat/traits.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::codegen::ir::hir::flat::component::HirFlatComponent;
use crate::codegen::ir::hir::flat::component::HirFlatComponentTrait;
use crate::codegen::ir::hir::misc::generation_source::HirGenerationSource;
use crate::codegen::ir::hir::misc::serializers::serialize_vec_syn;
use crate::utils::namespace::NamespacedName;
Expand All @@ -11,7 +11,7 @@ pub struct HirFlatTrait {
pub(crate) sources: Vec<HirGenerationSource>,
}

impl HirFlatComponent<NamespacedName> for HirFlatTrait {
impl HirFlatComponentTrait<NamespacedName> for HirFlatTrait {
fn sort_key(&self) -> NamespacedName {
self.name.clone()
}
Expand Down
4 changes: 2 additions & 2 deletions frb_codegen/src/library/codegen/ir/hir/flat/type_alias.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::codegen::ir::hir::flat::component::HirFlatComponent;
use crate::codegen::ir::hir::flat::component::HirFlatComponentTrait;
use crate::codegen::ir::hir::misc::serializers::serialize_syn;
use serde::Serialize;
use syn::Type;
Expand All @@ -10,7 +10,7 @@ pub struct HirFlatTypeAlias {
pub(crate) target: Type,
}

impl HirFlatComponent<String> for HirFlatTypeAlias {
impl HirFlatComponentTrait<String> for HirFlatTypeAlias {
fn sort_key(&self) -> String {
self.ident.to_string()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::codegen::ir::hir::flat::component::HirFlatComponent;
use crate::codegen::ir::hir::flat::component::HirFlatComponentTrait;
use crate::codegen::ir::hir::flat::pack::{HirFlatPack, HirFlatPackComponentVisitor};

pub(crate) fn transform(mut pack: HirFlatPack) -> anyhow::Result<HirFlatPack> {
Expand All @@ -9,7 +9,7 @@ pub(crate) fn transform(mut pack: HirFlatPack) -> anyhow::Result<HirFlatPack> {
struct Visitor;

impl HirFlatPackComponentVisitor for Visitor {
fn visit<SK: Ord, T: HirFlatComponent<SK>>(&self, items: &mut Vec<T>) {
fn visit<SK: Ord, T: HirFlatComponentTrait<SK>>(&self, items: &mut Vec<T>) {
items.sort_by_cached_key(|item| item.sort_key());
}
}

0 comments on commit 30f042a

Please sign in to comment.