code_passenger 0.1.1

Language-pack + header-plan driven code annotator: scans usage + auto-generates feature gates and doc headers.
Documentation
1
2
3
4
5
6
7
8
9
10
pub struct Lens<S, A> {
    pub get: fn(&S) -> &A,
    pub get_mut: fn(&mut S) -> &mut A,
}

impl<S, A> Lens<S, A> {
    pub fn over(&self, s: &mut S, f: impl FnOnce(&mut A)) {
        f((self.get_mut)(s));
    }
}