diff --git a/asyncgit/src/sync/commits_info.rs b/asyncgit/src/sync/commits_info.rs index 75f5066d..5d3ad820 100644 --- a/asyncgit/src/sync/commits_info.rs +++ b/asyncgit/src/sync/commits_info.rs @@ -30,9 +30,9 @@ impl ToString for CommitId { } } -impl Into for CommitId { - fn into(self) -> Oid { - self.0 +impl From for Oid { + fn from(id: CommitId) -> Self { + id.0 } } diff --git a/asyncgit/src/sync/ignore.rs b/asyncgit/src/sync/ignore.rs index 62e383ea..2054d0d2 100644 --- a/asyncgit/src/sync/ignore.rs +++ b/asyncgit/src/sync/ignore.rs @@ -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 { +fn file_ends_with_newline(file: &Path) -> Result { let mut file = File::open(file)?; let size = file.metadata()?.len(); diff --git a/asyncgit/src/sync/status.rs b/asyncgit/src/sync/status.rs index 0aad1cfd..0e7343e4 100644 --- a/asyncgit/src/sync/status.rs +++ b/asyncgit/src/sync/status.rs @@ -74,9 +74,9 @@ impl Default for StatusType { } } -impl Into for StatusType { - fn into(self) -> StatusShow { - match self { +impl From for StatusShow { + fn from(s: StatusType) -> Self { + match s { StatusType::WorkingDir => StatusShow::Workdir, StatusType::Stage => StatusShow::Index, StatusType::Both => StatusShow::IndexAndWorkdir, diff --git a/src/components/commit_details/details.rs b/src/components/commit_details/details.rs index 918fccbe..10a4ef7b 100644 --- a/src/components/commit_details/details.rs +++ b/src/components/commit_details/details.rs @@ -180,6 +180,7 @@ impl DetailsComponent { } } + #[allow(unstable_name_collisions)] fn get_text_info(&self) -> Vec { 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() diff --git a/src/ui/mod.rs b/src/ui/mod.rs index fa61d272..a1b3f67f 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -34,9 +34,12 @@ impl Size { } } -impl Into for Rect { - fn into(self) -> Size { - Size::new(self.width, self.height) +impl From for Size { + fn from(r: Rect) -> Self { + Self { + width: r.width, + height: r.height, + } } }