Skip to content
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
16 changes: 16 additions & 0 deletions src/lazy_load_blob.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pub use crate::LazyLoadBlob;

impl std::default::Default for LazyLoadBlob {
fn default() -> Self {
LazyLoadBlob {
mime: None,
bytes: Vec::new(),
}
}
}

impl std::cmp::PartialEq for LazyLoadBlob {
fn eq(&self, other: &Self) -> bool {
self.mime == other.mime && self.bytes == other.bytes
}
}
11 changes: 2 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ mod on_exit;
pub use on_exit::OnExit;
mod capability;
pub use capability::Capability;
mod lazy_load_blob;
pub use lazy_load_blob::LazyLoadBlob;

/// Implement the wit-bindgen specific code that the kernel uses to hook into
/// a process. Write an `init(our: Address)` function and call it with this.
Expand Down Expand Up @@ -134,15 +136,6 @@ pub fn spawn(
)
}

impl std::default::Default for LazyLoadBlob {
fn default() -> Self {
LazyLoadBlob {
mime: None,
bytes: Vec::new(),
}
}
}

/// Create a blob with no MIME type and a generic type, plus a serializer
/// function that turns that type into bytes.
///
Expand Down