diff options
author | 2017-12-09 14:43:29 +0100 | |
---|---|---|
committer | 2017-12-09 17:17:56 +0100 | |
commit | a6dd004113fcbc03ffacacc519d742ee84886c1d (patch) | |
tree | 66b70421a0ab00ab8a2be2fb990c15223e495535 /macros/src/analyze.rs | |
parent | 219e17268018f397ff3c8a41519c8345aeab7f2f (diff) | |
download | rtic-a6dd004113fcbc03ffacacc519d742ee84886c1d.tar.gz rtic-a6dd004113fcbc03ffacacc519d742ee84886c1d.tar.zst rtic-a6dd004113fcbc03ffacacc519d742ee84886c1d.zip |
implement the Resource trait for owned resources
this unbreaks the "generics" example
Diffstat (limited to 'macros/src/analyze.rs')
-rw-r--r-- | macros/src/analyze.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/macros/src/analyze.rs b/macros/src/analyze.rs index 0fc125da..65d98e69 100644 --- a/macros/src/analyze.rs +++ b/macros/src/analyze.rs @@ -17,6 +17,13 @@ pub enum Ownership { } impl Ownership { + pub fn ceiling(&self) -> u8 { + match *self { + Ownership::Owned { priority } => priority, + Ownership::Shared { ceiling } => ceiling, + } + } + pub fn is_owned(&self) -> bool { match *self { Ownership::Owned { .. } => true, |