mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-27 00:14:52 +03:00
cleanup nightly clippy warnings
This commit is contained in:
parent
46de25546d
commit
b63063271d
@ -30,9 +30,9 @@ impl ToString for CommitId {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Oid> for CommitId {
|
||||
fn into(self) -> Oid {
|
||||
self.0
|
||||
impl From<CommitId> for Oid {
|
||||
fn from(id: CommitId) -> Self {
|
||||
id.0
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ use scopetime::scope_time;
|
||||
use std::{
|
||||
fs::{File, OpenOptions},
|
||||
io::{Read, Seek, SeekFrom, Write},
|
||||
path::PathBuf,
|
||||
path::Path,
|
||||
};
|
||||
|
||||
static GITIGNORE: &str = ".gitignore";
|
||||
@ -38,7 +38,7 @@ pub fn add_to_ignore(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn file_ends_with_newline(file: &PathBuf) -> Result<bool> {
|
||||
fn file_ends_with_newline(file: &Path) -> Result<bool> {
|
||||
let mut file = File::open(file)?;
|
||||
let size = file.metadata()?.len();
|
||||
|
||||
|
@ -74,9 +74,9 @@ impl Default for StatusType {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<StatusShow> for StatusType {
|
||||
fn into(self) -> StatusShow {
|
||||
match self {
|
||||
impl From<StatusType> for StatusShow {
|
||||
fn from(s: StatusType) -> Self {
|
||||
match s {
|
||||
StatusType::WorkingDir => StatusShow::Workdir,
|
||||
StatusType::Stage => StatusShow::Index,
|
||||
StatusType::Both => StatusShow::IndexAndWorkdir,
|
||||
|
@ -180,6 +180,7 @@ impl DetailsComponent {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unstable_name_collisions)]
|
||||
fn get_text_info(&self) -> Vec<Spans> {
|
||||
if let Some(ref data) = self.data {
|
||||
let mut res = vec![
|
||||
@ -247,6 +248,7 @@ impl DetailsComponent {
|
||||
res.push(Spans::from(
|
||||
self.style_detail(&Detail::Sha),
|
||||
));
|
||||
|
||||
res.push(Spans::from(
|
||||
self.tags
|
||||
.iter()
|
||||
|
@ -34,9 +34,12 @@ impl Size {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Size> for Rect {
|
||||
fn into(self) -> Size {
|
||||
Size::new(self.width, self.height)
|
||||
impl From<Rect> for Size {
|
||||
fn from(r: Rect) -> Self {
|
||||
Self {
|
||||
width: r.width,
|
||||
height: r.height,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user