From e4319de3d526285381f5cc53e14f9a17d123a81a Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 3 Apr 2021 20:30:34 +0300 Subject: const generics --- macros/src/codegen/util.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'macros/src/codegen/util.rs') diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 86bd6955..c2330d46 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -8,23 +8,10 @@ use syn::{Attribute, Ident, LitInt, PatType}; use crate::check::Extra; /// Turns `capacity` into an unsuffixed integer literal -pub fn capacity_literal(capacity: u8) -> LitInt { +pub fn capacity_literal(capacity: usize) -> LitInt { LitInt::new(&capacity.to_string(), Span::call_site()) } -/// Turns `capacity` into a type-level (`typenum`) integer -pub fn capacity_typenum(capacity: u8, round_up_to_power_of_two: bool) -> TokenStream2 { - let capacity = if round_up_to_power_of_two { - capacity.checked_next_power_of_two().expect("UNREACHABLE") - } else { - capacity - }; - - let ident = Ident::new(&format!("U{}", capacity), Span::call_site()); - - quote!(rtic::export::consts::#ident) -} - /// Identifier for the free queue pub fn fq_ident(task: &Ident) -> Ident { Ident::new(&format!("{}_FQ", task.to_string()), Span::call_site()) -- cgit v1.2.3