Skip to content

Commit

Permalink
switch schema name for [T] from "&[T]" to "[T]"
Browse files Browse the repository at this point in the history
  • Loading branch information
max-heller committed Nov 23, 2024
1 parent 7544011 commit 37c207c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/postcard-schema/src/impls/builtins_nostd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<T: Schema + ?Sized> Schema for &'_ T {

impl<T: Schema> Schema for [T] {
const SCHEMA: &'static NamedType = &NamedType {
name: "&[T]",
name: "[T]",
ty: &DataModelType::Seq(T::SCHEMA),
};
}
Expand Down
6 changes: 3 additions & 3 deletions source/postcard-schema/tests/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ fn test_struct_serialize() {
&NamedValue {
name: "f",
ty: &NamedType {
name: "&[T]",
name: "[T]",
ty: &DataModelType::Seq(&NamedType {
name: "u8",
ty: &DataModelType::U8
Expand All @@ -156,7 +156,7 @@ fn test_slice_serialize() {
ty: &DataModelType::Struct(&[&NamedValue {
name: "x",
ty: &NamedType {
name: "&[T]",
name: "[T]",
ty: &DataModelType::Seq(&U8_SCHEMA)
}
},]),
Expand Down Expand Up @@ -204,7 +204,7 @@ fn owned_punning() {

// TODO: This is wildly repetitive, and likely could benefit from interning of
// repeated types, strings, etc.
assert_eq!(ser_borrowed_schema.len(), 269);
assert_eq!(ser_borrowed_schema.len(), 268);

// Check that we round-trip correctly
let deser_borrowed_schema =
Expand Down

0 comments on commit 37c207c

Please sign in to comment.