Skip to content

Commit

Permalink
Refactor: move cairo-lang-macro types to submodule
Browse files Browse the repository at this point in the history
commit-id:ddf4c6b4
  • Loading branch information
maciektr committed Mar 19, 2024
1 parent 398cac2 commit a56d570
Show file tree
Hide file tree
Showing 5 changed files with 591 additions and 571 deletions.
8 changes: 8 additions & 0 deletions plugins/cairo-lang-macro-stable/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ impl<T> StableSlice<T> {
(self.ptr, self.len)
}
}

/// This struct defines an Option in stable ABI representation.
#[repr(C)]
#[derive(Debug)]
pub enum StableOption<T> {
None,
Some(T),
}
12 changes: 1 addition & 11 deletions plugins/cairo-lang-macro-stable/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
use crate::ffi::StableSlice;
use crate::ffi::{StableOption, StableSlice};
use std::ffi::CStr;
use std::num::NonZeroU8;
use std::os::raw::c_char;
use std::ptr::NonNull;

pub mod ffi;

/// An option.
///
/// This struct implements FFI-safe stable ABI.
#[repr(C)]
#[derive(Debug)]
pub enum StableOption<T> {
None,
Some(T),
}

/// Token stream.
///
/// This struct implements FFI-safe stable ABI.
Expand Down
Loading

0 comments on commit a56d570

Please sign in to comment.