Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elide lifetimes in impls where possible #143

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ocrs-cli/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub enum ModelSource<'a> {
Path(&'a str),
}

impl<'a> fmt::Display for ModelSource<'a> {
impl fmt::Display for ModelSource<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
Expand Down
2 changes: 1 addition & 1 deletion ocrs/src/preprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl<'a> From<NdTensorView<'a, u8, 3>> for ImagePixels<'a> {
}
}

impl<'a> ImagePixels<'a> {
impl ImagePixels<'_> {
fn shape(&self) -> [usize; 3] {
match self {
ImagePixels::Floats(f) => f.shape(),
Expand Down
6 changes: 3 additions & 3 deletions ocrs/src/text_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ pub struct TextWord<'a> {
}

impl<'a> TextWord<'a> {
fn new(chars: &'a [TextChar]) -> TextWord {
fn new(chars: &'a [TextChar]) -> TextWord<'a> {
assert!(!chars.is_empty(), "Text words must not be empty");
TextWord { chars }
}
}

impl<'a> TextItem for TextWord<'a> {
impl TextItem for TextWord<'_> {
fn chars(&self) -> &[TextChar] {
self.chars
}
}

impl<'a> fmt::Display for TextWord<'a> {
impl fmt::Display for TextWord<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt_text_item(self, f)
}
Expand Down
Loading