Skip to content

Adds support for multiple errors from the resolver #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev-1.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ion-schema/src/model/constraints/annotations/v2_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ impl TypeDefinitionBuilder<ISL_2_0> {
///
/// # Arguments
/// * `modifier` - An [`AnnotationsV2Modifier`] that specifies how the annotations should be applied
/// (e.g., required, closed, or both)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪧 This was a clippy suggestion.

/// (e.g., required, closed, or both)
/// * `annotations` - An iterable collection of items that can be converted into [`Symbol`],
/// representing the annotation names
/// representing the annotation names
///
/// # Returns
/// * Returns `Self` to allow for method chaining in the builder pattern
Expand Down
16 changes: 16 additions & 0 deletions ion-schema/src/model/schema_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@ impl Import {
.and_then(|type_import| type_import.alias.as_deref())
}
}
impl Display for Import {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str("{id:")?;
f.write_str(&self.schema_id)?;
if let Some(name) = self.type_name() {
f.write_str(",type:")?;
f.write_str(name)?;
if let Some(alias) = self.type_alias() {
f.write_str(",as:")?;
f.write_str(alias)?;
}
}
f.write_char('}')?;
Ok(())
}
}
impl HasIslSourceLocation for Import {
fn isl_source_location(&self) -> IslSourceLocation {
self.source_location
Expand Down
2 changes: 1 addition & 1 deletion ion-schema/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub use resolved_schema::*;
pub(crate) use type_ref_visitor::*;

/// A schema index and type index.
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
pub(crate) struct TypeCoordinates(usize, usize);
impl TypeCoordinates {
#[cfg(test)]
Expand Down
Loading
Loading