Skip to content

Commit

Permalink
fix: ensure kernel library is usable as a library
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed Aug 10, 2024
1 parent 48f8e7e commit a1c60c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

#### Enhancements

- Exposed some pretty printing internals for `MastNode`
- Made `KernelLibrary` impl `Clone` and `AsRef<Library>`

## 0.10.0 (2024-08-06)

#### Features
Expand Down
8 changes: 8 additions & 0 deletions assembly/src/library/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,20 @@ impl Export {
/// - All exported procedures must be exported directly from the kernel namespace (i.e., `#sys`).
/// - There must be at least one exported procedure.
/// - The number of exported procedures cannot exceed [Kernel::MAX_NUM_PROCEDURES] (i.e., 256).
#[derive(Clone)]
pub struct KernelLibrary {
kernel: Kernel,
kernel_info: ModuleInfo,
library: Library,
}

impl AsRef<Library> for KernelLibrary {
#[inline(always)]
fn as_ref(&self) -> &Library {
&self.library
}
}

impl KernelLibrary {
/// Returns the inner [`MastForest`].
pub fn mast_forest(&self) -> &MastForest {
Expand Down

0 comments on commit a1c60c9

Please sign in to comment.