~/selfhut

selfhut/src/repository/raw.rs -rw-r--r-- 344 B
19f9b68c — arthurmelton format code 2 years ago
1
2
3
4
5
6
7
8
9
10
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, branch, location.get().display().to_string()) {
        Some(file) => Some(file.2),
        None => None,
    }
}