Skip to content
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

fix: Move declarative.yaml example to the hugr-core crate #1131

Merged
merged 1 commit into from
May 29, 2024
Merged
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
6 changes: 3 additions & 3 deletions hugr-core/src/extension/declarative.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
//! ### Example
//!
//! ```yaml
#![doc = include_str!("../../../hugr/examples/extension/declarative.yaml")]
#![doc = include_str!("../../examples/extension/declarative.yaml")]
//! ```
//!
//! The definition can be loaded into a registry using the [`load_extensions`] or [`load_extensions_file`] functions.
//! ```rust
//! # const DECLARATIVE_YAML: &str = include_str!("../../../hugr/examples/extension/declarative.yaml");
//! # const DECLARATIVE_YAML: &str = include_str!("../../examples/extension/declarative.yaml");
//! # use hugr::extension::declarative::load_extensions;
//! // Required extensions must already be present in the registry.
//! let mut reg = hugr::std_extensions::logic::LOGIC_REG.clone();
Expand Down Expand Up @@ -327,7 +327,7 @@ extensions:
"#;

/// The yaml used in the module documentation.
const EXAMPLE_YAML_FILE: &str = "../hugr/examples/extension/declarative.yaml";
const EXAMPLE_YAML_FILE: &str = "examples/extension/declarative.yaml";

#[rstest]
#[case(EMPTY_YAML, 1, 0, 0, &PRELUDE_REGISTRY)]
Expand Down