knave 0.14.16

A Lisp programming language 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
16
use crate::build::{GitStore, StoreError};

#[derive(Default)]
pub struct UserGitStore {
    store: Option<GitStore>,
}

impl UserGitStore {
    pub fn opened(&mut self) -> Result<&GitStore, StoreError> {
        let store = match self.store.take() {
            Some(store) => store,
            None => GitStore::for_user()?,
        };
        Ok(self.store.insert(store))
    }
}