Skip to content

Commit 1356512

Browse files
committed
refactor: Revert RustMeta as RustPath's parent ABC
1 parent 9b33ef0 commit 1356512

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

schema_salad/rust_codegen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def parse_generics_string(value_generics: str) -> RustGenerics:
275275

276276

277277
@dataclass(unsafe_hash=True) # ASSERT: Immutable class
278-
class RustPath:
278+
class RustPath(RustMeta):
279279
"""
280280
Represents a complete Rust path (e.g., `::std::vec::Vec<T>`).
281281
"""
@@ -354,7 +354,7 @@ class RustMetaList(RustMeta):
354354
"""
355355

356356
path: RustPath
357-
metas: Sequence[Union[RustMeta, RustPath]] = tuple()
357+
metas: Sequence[RustMeta] = tuple()
358358

359359
def __hash__(self) -> int:
360360
return hash(self.path)
@@ -1082,7 +1082,7 @@ def __parse_field_schema_attrs(schema: SaladField) -> tuple[RustAttributes, int]
10821082
)
10831083
docs_count = len(attrs)
10841084

1085-
metas = []
1085+
metas: list[RustMeta] = []
10861086
if default := schema.get_prop("default"):
10871087
metas.append(RustMetaNameValue(path=RustPath.from_str("default"), value=default))
10881088
if jsonld_predicate := schema.get_prop("jsonldPredicate"):

0 commit comments

Comments
 (0)