Skip to content

Commit

Permalink
chore: clippy lints and fmt *
Browse files Browse the repository at this point in the history
  • Loading branch information
oknozor committed Jan 19, 2021
1 parent 3c4f601 commit 09ed3e6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/conventional/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use anyhow::Result;
use chrono::{NaiveDateTime, Utc};
use colored::*;
use git2::Commit as Git2Commit;
use std::fmt::Formatter;
use std::cmp::Ordering;
use std::fmt;
use std::fmt::Formatter;

#[derive(Debug, Eq, PartialEq)]
pub struct Commit {
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::git::status::Statuses;
use colored::*;
use std::fmt::Formatter;
use std::fmt;
use std::fmt::Formatter;
use thiserror::Error;

#[derive(Error, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/git/repository.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::status::Statuses;
use semver::Version;
use crate::error::ErrorKind;
use crate::error::ErrorKind::Git;
use crate::OidOf;
Expand All @@ -9,6 +8,7 @@ use git2::{
Commit as Git2Commit, Diff, DiffOptions, IndexAddOption, Object, ObjectType, Oid,
Repository as Git2Repository, StatusOptions,
};
use semver::Version;
use std::path::Path;

pub(crate) struct Repository(pub(crate) Git2Repository);
Expand Down
7 changes: 2 additions & 5 deletions src/git/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::git::status::Changes::{Deleted, Modified, New, Renamed, TypeChange};
use colored::*;
use git2::StatusEntry as Git2StatusEntry;
use git2::Statuses as Git2Statuses;
use std::fmt::Formatter;
use std::fmt;
use std::fmt::Formatter;

pub(crate) struct Statuses(pub Vec<Status>);

Expand Down Expand Up @@ -42,10 +42,7 @@ impl From<Git2Statuses<'_>> for Statuses {

impl<'a, 'b: 'a> From<Git2StatusEntry<'b>> for Status {
fn from(status: Git2StatusEntry<'b>) -> Self {
let path = status
.path()
.unwrap_or_else(|| "invalid utf8 path")
.to_string();
let path = status.path().unwrap_or("invalid utf8 path").to_string();
match status.status() {
s if s.is_wt_new() => Status::Untracked(New(path)),
s if s.is_wt_renamed() => Status::Untracked(Renamed(path)),
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ use hook::Hook;
use itertools::Itertools;
use log::filter::CommitFilters;
use semver::Version;
use settings::AuthorSetting;
use std::fmt::Display;
use std::fmt::Formatter;
use settings::AuthorSetting;
use std::fs::File;
use std::io::Write;
use std::path::{Path, PathBuf};
Expand Down

0 comments on commit 09ed3e6

Please sign in to comment.