mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-08 10:58:33 +03:00
Merge pull request #2106 from gitbutlerapp/don-t-try-to-cast-from-i32-just-truncate
truncate instead of i32::try_from() when building index entry
This commit is contained in:
commit
2407f8b279
@ -144,16 +144,11 @@ impl From<git2::IndexEntry> for IndexEntry {
|
||||
}
|
||||
|
||||
impl From<IndexEntry> for git2::IndexEntry {
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
fn from(entry: IndexEntry) -> Self {
|
||||
Self {
|
||||
ctime: git2::IndexTime::new(
|
||||
i32::try_from(entry.ctime.seconds()).unwrap(),
|
||||
entry.ctime.nanoseconds(),
|
||||
),
|
||||
mtime: git2::IndexTime::new(
|
||||
i32::try_from(entry.mtime.seconds()).unwrap(),
|
||||
entry.mtime.nanoseconds(),
|
||||
),
|
||||
ctime: git2::IndexTime::new(entry.ctime.seconds() as i32, entry.ctime.nanoseconds()),
|
||||
mtime: git2::IndexTime::new(entry.mtime.seconds() as i32, entry.mtime.nanoseconds()),
|
||||
dev: entry.dev,
|
||||
ino: entry.ino,
|
||||
mode: entry.mode,
|
||||
|
Loading…
Reference in New Issue
Block a user