Skip to content

Commit

Permalink
Rename object to struct
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont committed Aug 31, 2023
1 parent 07b6ba4 commit b099d89
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/datatype/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use std::{

mod r#enum;
mod literal;
mod object;
mod primitive;
mod r#struct;
mod tuple;

pub use literal::*;
pub use object::*;
pub use primitive::*;
pub use r#enum::*;
pub use r#struct::*;
pub use tuple::*;

use crate::{ImplLocation, TypeSid};
Expand Down Expand Up @@ -48,7 +48,7 @@ pub enum DataType {
// Named reference types
Named(NamedDataType),
// Anonymous Reference types
Object(ObjectType),
Struct(ObjectType),
Enum(EnumType),
Tuple(TupleType),
// Result
Expand Down
2 changes: 1 addition & 1 deletion src/datatype/object.rs → src/datatype/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct ObjectType {
impl ObjectType {
/// Convert a [`ObjectType`] to an anonymous [`DataType`].
pub fn to_anonymous(self) -> DataType {
DataType::Object(self)
DataType::Struct(self)
}

/// Convert a [`ObjectType`] to a named [`NamedDataType`].
Expand Down
2 changes: 1 addition & 1 deletion src/lang/ts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn datatype_inner(ctx: ExportContext, typ: &DataType, type_map: &TypeMap) -> Out
format!("{dt}[]")
}
}
DataType::Object(item) => object_datatype(ctx, None, item, type_map)?,
DataType::Struct(item) => object_datatype(ctx, None, item, type_map)?,
DataType::Enum(item) => enum_datatype(ctx, None, item, type_map)?,
DataType::Tuple(tuple) => tuple_datatype(ctx, tuple, type_map)?,
DataType::Named(typ) => {
Expand Down
2 changes: 1 addition & 1 deletion src/type/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub enum Infallible {}
impl<T: Type> Type for std::ops::Range<T> {
fn inline(opts: DefOpts, _generics: &[DataType]) -> Result<DataType, ExportError> {
let ty = T::definition(opts)?;
Ok(DataType::Object(ObjectType {
Ok(DataType::Struct(ObjectType {
generics: vec![],
fields: vec![
ObjectField {
Expand Down

0 comments on commit b099d89

Please sign in to comment.