From 6283036815b6679774f84931ad4e543590344e31 Mon Sep 17 00:00:00 2001 From: lyken Date: Tue, 27 Aug 2024 17:33:17 +0800 Subject: [PATCH] FieldTraversal::{Out -> Output} --- nac3core/src/codegen/model/structure.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nac3core/src/codegen/model/structure.rs b/nac3core/src/codegen/model/structure.rs index 67985805..c158bd94 100644 --- a/nac3core/src/codegen/model/structure.rs +++ b/nac3core/src/codegen/model/structure.rs @@ -13,16 +13,16 @@ use super::*; /// A traveral that traverses a Rust `struct` that is used to declare an LLVM's struct's field types. pub trait FieldTraversal<'ctx> { /// Output type of [`FieldTraversal::add`]. - type Out; + type Output; /// Traverse through the type of a declared field and do something with it. /// /// * `name` - The cosmetic name of the LLVM field. Used for debugging. /// * `model` - The [`Model`] representing the LLVM type of this field. - fn add>(&mut self, name: &'static str, model: M) -> Self::Out; + fn add>(&mut self, name: &'static str, model: M) -> Self::Output; /// Like [`FieldTraversal::add`] but [`Model`] is automatically inferred from its [`Default`] trait. - fn add_auto + Default>(&mut self, name: &'static str) -> Self::Out { + fn add_auto + Default>(&mut self, name: &'static str) -> Self::Output { self.add(name, M::default()) } } @@ -45,12 +45,12 @@ pub struct GepFieldTraversal { } impl<'ctx> FieldTraversal<'ctx> for GepFieldTraversal { - type Out = GepField; + type Output = GepField; - fn add>(&mut self, name: &'static str, model: M) -> Self::Out { + fn add>(&mut self, name: &'static str, model: M) -> Self::Output { let gep_index = self.gep_index_counter; self.gep_index_counter += 1; - Self::Out { gep_index, name, model } + Self::Output { gep_index, name, model } } } @@ -65,9 +65,9 @@ struct TypeFieldTraversal<'ctx, 'a, G: CodeGenerator + ?Sized> { } impl<'ctx, 'a, G: CodeGenerator + ?Sized> FieldTraversal<'ctx> for TypeFieldTraversal<'ctx, 'a, G> { - type Out = (); // Checking types return nothing. + type Output = (); // Checking types return nothing. - fn add>(&mut self, _name: &'static str, model: M) -> Self::Out { + fn add>(&mut self, _name: &'static str, model: M) -> Self::Output { let t = model.llvm_type(self.generator, self.ctx).as_basic_type_enum(); self.field_types.push(t); } @@ -89,9 +89,9 @@ struct CheckTypeFieldTraversal<'ctx, 'a, G: CodeGenerator + ?Sized> { impl<'ctx, 'a, G: CodeGenerator + ?Sized> FieldTraversal<'ctx> for CheckTypeFieldTraversal<'ctx, 'a, G> { - type Out = (); // Checking types return nothing. + type Output = (); // Checking types return nothing. - fn add>(&mut self, name: &'static str, model: M) -> Self::Out { + fn add>(&mut self, name: &'static str, model: M) -> Self::Output { let gep_index = self.gep_index_counter; self.gep_index_counter += 1;