~/selfhut

selfhut/src/repository/raw.rs -rw-r--r-- 421 B
616316d3 — Arthur Melton fix some errors 2 years ago
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26





use crate::git::file::{file};
use crate::PathBufWithDotfiles;








#[get("/<repo>/blob/<branch>/<location..>", rank=2)]
pub fn raw(repo: String, branch: String, location: PathBufWithDotfiles) -> Option<Vec<u8>> {
    match file(repo.clone(), branch.clone(), location.get().display().to_string()) {
        Some(file) => {
            Some(file.2) 
        },
        None => { 
            None
        }
    }
}