Skip to content

Commit

Permalink
Remove .expect and propagate errors up
Browse files Browse the repository at this point in the history
  • Loading branch information
TTWNO committed May 30, 2024
1 parent 910d537 commit a8f20b8
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,22 +624,9 @@ impl CacheItem {
// this variation does NOT get a semantic line. It gets a visual line.
let dbus_version = as_text(self)
.await?
.get_string_at_offset(
offset.try_into().expect("Can not convert between usize and i32"),
granularity,
)
.get_string_at_offset(offset.try_into()?, granularity)
.await?;
Ok((
dbus_version.0,
dbus_version
.1
.try_into()
.expect("Can not convert between usize and i32"),
dbus_version
.2
.try_into()
.expect("Can not convert between usize and i32"),
))
Ok((dbus_version.0, dbus_version.1.try_into()?, dbus_version.2.try_into()?))
}
pub fn get_text(
&self,
Expand Down

0 comments on commit a8f20b8

Please sign in to comment.