Skip to content

Commit

Permalink
move-panama-backend - fix compile for older rust version?
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist1 committed Sep 20, 2024
1 parent 2a98363 commit 9332c83
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cli/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,14 @@ struct TyGenContext<'a, 'cx> {
}

#[derive(Debug, Clone)]
struct Conversion<'cx> {
pub(crate) struct Conversion<'cx> {
conversion: Cow<'cx, str>,
converted_value: Cow<'cx, str>,
}

mod arena {
use std::fmt::Display;
pub type Render<'cx> = Box<dyn Fn(Arena<'cx>) -> Conversion<'cx> + 'cx>;
pub(crate) type Render<'cx> = Box<dyn Fn(Arena<'cx>) -> Conversion<'cx> + 'cx>;

const UNIT: &() = &();
use super::Conversion;
Expand All @@ -386,19 +386,19 @@ mod arena {
_marker: &'cx (),
}
impl<'cx, F: Fn(Arena<'cx>) -> Conversion<'cx> + 'cx> AllocationConversion<'cx, F> {
pub fn dynamic(clos: F) -> AllocationConversion<'cx, Render<'cx>> {
pub(crate) fn dynamic(clos: F) -> AllocationConversion<'cx, Render<'cx>> {
AllocationConversion {
clos: Box::new(clos) as Render<'cx>,
_marker: UNIT,
}
}

pub fn render(self, arena: Arena<'cx>) -> Conversion<'cx> {
pub(crate) fn render(self, arena: Arena<'cx>) -> Conversion<'cx> {
(self.clos)(arena)
}
}

pub enum Arena<'cx> {
pub(crate) enum Arena<'cx> {
Closed,
Auto,
#[allow(unused)]
Expand All @@ -416,7 +416,7 @@ mod arena {
}
}

enum AllocateConversion<'cx, F: Fn(arena::Arena<'cx>) -> Conversion<'cx>> {
pub(crate) enum AllocateConversion<'cx, F: Fn(arena::Arena<'cx>) -> Conversion<'cx>> {
NotAllocating(Conversion<'cx>),
Allocating(arena::AllocationConversion<'cx, F>),
}
Expand Down

0 comments on commit 9332c83

Please sign in to comment.