Skip to content

Commit 4c51bbf

Browse files
authored
Adds support for multiple errors from the resolver (#247)
* Adds support for multiple errors from the resolver * Add missing test assertion
1 parent e5f742a commit 4c51bbf

File tree

5 files changed

+355
-97
lines changed

5 files changed

+355
-97
lines changed

ion-schema/src/model/constraints/annotations/v2_simple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ impl TypeDefinitionBuilder<ISL_2_0> {
111111
///
112112
/// # Arguments
113113
/// * `modifier` - An [`AnnotationsV2Modifier`] that specifies how the annotations should be applied
114-
/// (e.g., required, closed, or both)
114+
/// (e.g., required, closed, or both)
115115
/// * `annotations` - An iterable collection of items that can be converted into [`Symbol`],
116-
/// representing the annotation names
116+
/// representing the annotation names
117117
///
118118
/// # Returns
119119
/// * Returns `Self` to allow for method chaining in the builder pattern

ion-schema/src/model/schema_header.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ impl Import {
9494
.and_then(|type_import| type_import.alias.as_deref())
9595
}
9696
}
97+
impl Display for Import {
98+
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
99+
f.write_str("{id:")?;
100+
f.write_str(&self.schema_id)?;
101+
if let Some(name) = self.type_name() {
102+
f.write_str(",type:")?;
103+
f.write_str(name)?;
104+
if let Some(alias) = self.type_alias() {
105+
f.write_str(",as:")?;
106+
f.write_str(alias)?;
107+
}
108+
}
109+
f.write_char('}')?;
110+
Ok(())
111+
}
112+
}
97113
impl HasIslSourceLocation for Import {
98114
fn isl_source_location(&self) -> IslSourceLocation {
99115
self.source_location

ion-schema/src/resolver/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub use resolved_schema::*;
1313
pub(crate) use type_ref_visitor::*;
1414

1515
/// A schema index and type index.
16-
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq)]
16+
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
1717
pub(crate) struct TypeCoordinates(usize, usize);
1818
impl TypeCoordinates {
1919
#[cfg(test)]

0 commit comments

Comments
 (0)