~/selfhut

01f10fe8fd15cc787961fdd1595e8900f9063bc4 — Arthur Melton 69345aa0 2 years ago
format code
3 files changed, 10 insertions(+), 10 deletions(-)

M src/main.rs
M src/repository/commit.rs
M src/repository/mod.rs
M src/main.rs => src/main.rs +1 -1
@@ 12,11 12,11 @@ use rocket::fs::relative;

use std::path::Path;

use crate::repository::blame;
use crate::repository::commit;
use crate::repository::log;
use crate::repository::raw;
use crate::repository::summary;
use crate::repository::tree;
use crate::repository::commit;
use crate::utils::own_pathbuf::PathBufWithDotfiles;
use rocket_dyn_templates::Template;


M src/repository/commit.rs => src/repository/commit.rs +8 -8
@@ 1,20 1,20 @@

use crate::config::CONFIG;
use crate::git::blame::blame;
use crate::git::commits::get_commits;
use crate::git::file::file;
use crate::git::diffs::diffs;
use serde_derive::Serialize;
use crate::git::file::file;
use git2::DiffLineType::*;
use serde_derive::Serialize;

use crate::utils::repo_config::repo_config;
use crate::PathBufWithDotfiles;
use git2::Delta::*;
use rocket_dyn_templates::{context, Template};
use std::ffi::OsStr;
use std::path::Path;
use syntect::highlighting::ThemeSet;
use syntect::html::highlighted_html_for_string;
use syntect::parsing::SyntaxSet;
use git2::Delta::*;

#[get("/<repo>/commit/<oid>", rank = 2)]
pub fn commit(repo: String, oid: String) -> Option<Template> {

@@ 109,7 109,7 @@ pub fn commit(repo: String, oid: String) -> Option<Template> {

                            Conflicted => 'C',
                            _ => ' ',
                        },
                        insertions: patch.line_stats().ok()?.1, 
                        insertions: patch.line_stats().ok()?.1,
                        deletions: patch.line_stats().ok()?.2,
                        hunks
                    });

@@ 117,7 117,7 @@ pub fn commit(repo: String, oid: String) -> Option<Template> {

                }
                items
            },
        }
        },
    ))
}


@@ 139,7 139,7 @@ pub struct Files {

    status: char,
    insertions: usize,
    deletions: usize,
    hunks: Vec<Hunk>
    hunks: Vec<Hunk>,
}

#[derive(Serialize, Clone)]

@@ 150,7 150,7 @@ pub struct Hunk {

    third: u32,
    fourth: u32,
    first_line: String,
    lines: Vec<Lines>
    lines: Vec<Lines>,
}

#[derive(Serialize, Clone)]

@@ 158,5 158,5 @@ pub struct Lines {

    line_n: usize,
    class: String,
    types: char,
    line: String
    line: String,
}

M src/repository/mod.rs => src/repository/mod.rs +1 -1
@@ 1,6 1,6 @@

pub mod blame;
pub mod commit;
pub mod log;
pub mod raw;
pub mod summary;
pub mod tree;
pub mod commit;