knave 0.11.0

A small Lisp for humans and agents that infers types and ownership and compiles to readable Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::types::{FieldPlace, TypedExpr};

pub enum StructUpdateOrder<'a> {
    FieldsBeforePlace(FieldPlace<'a>),
    BaseFirst,
}

impl<'a> StructUpdateOrder<'a> {
    pub fn of(base: &'a TypedExpr) -> Self {
        match base.field_place() {
            Some(place) => Self::FieldsBeforePlace(place),
            None => Self::BaseFirst,
        }
    }
}