From 5dd2cbc352cb31738ce21505700780c563f705dd Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:12:18 +0100 Subject: [PATCH 01/12] add unimplemented error type --- crates/ohno/src/lib.rs | 3 +- crates/ohno/src/unimplemented.rs | 116 +++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 crates/ohno/src/unimplemented.rs diff --git a/crates/ohno/src/lib.rs b/crates/ohno/src/lib.rs index dcfb6301..28553462 100644 --- a/crates/ohno/src/lib.rs +++ b/crates/ohno/src/lib.rs @@ -235,13 +235,14 @@ mod error_ext; mod error_trace; mod source; mod trace_info; +mod unimplemented; #[cfg(any(feature = "test-util", test))] pub mod test_util; pub use core::OhnoCore; - pub use error_ext::ErrorExt; pub use error_trace::{ErrorTrace, ErrorTraceExt}; pub use ohno_macros::{Error, error, error_trace}; pub use trace_info::{Location, TraceInfo}; +pub use unimplemented::Unimplemented; \ No newline at end of file diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs new file mode 100644 index 00000000..33457856 --- /dev/null +++ b/crates/ohno/src/unimplemented.rs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +//! `Unimplemented` error type. + +use std::borrow::Cow; + +use crate::OhnoCore; + +#[derive(crate::Error, Clone)] +#[no_constructors] +#[display("not implemented at {file}:{line}")] +pub struct Unimplemented { + file: Cow<'static, str>, + line: usize, + core: OhnoCore, +} + +impl Unimplemented { + #[must_use] + pub fn new(file: Cow<'static, str>, line: usize) -> Self { + Self { + file, + line, + core: OhnoCore::new(), + } + } + + #[must_use] + pub fn with_message( + message: impl Into>, + file: Cow<'static, str>, + line: usize, + ) -> Self { + Self { + file, + line, + core: OhnoCore::from(message.into()), + } + } + + pub fn file(&self) -> &str { + &self.file + } + + pub fn line(&self) -> usize { + self.line + } +} + +#[macro_export] +macro_rules! unimplemented_error { + () => { + return Err($crate::Unimplemented::new( + std::borrow::Cow::Borrowed(file!()), + line!() as usize, + ) + .into()) + }; + ($ex:expr) => { + return Err($crate::Unimplemented::with_message( + $ex, + std::borrow::Cow::Borrowed(file!()), + line!() as usize, + ) + .into()) + }; +} + +#[cfg(test)] +mod test { + use ohno::ErrorExt; + + use super::*; + + #[test] + fn basic() { + fn return_err() -> Result<(), Unimplemented> { + unimplemented_error!() + } + let err = return_err().unwrap_err(); + assert!(err.message().starts_with("not implemented at "), "{err}"); + } + + #[test] + fn with_message() { + fn return_err() -> Result<(), Unimplemented> { + unimplemented_error!("custom message") + } + + let err = return_err().unwrap_err(); + let message = err.message(); + assert!(message.starts_with("not implemented at "), "{message}"); + assert!(message.contains("custom message"), "{message}"); + } + + #[test] + fn automatic_conversion() { + #[derive(Debug)] + struct CustomError(Unimplemented); + + impl From for CustomError { + fn from(err: Unimplemented) -> Self { + Self(err) + } + } + + fn return_custom_err() -> Result<(), CustomError> { + unimplemented_error!() + } + + let err = return_custom_err().unwrap_err(); + let message = err.0.message(); + assert!(message.starts_with("not implemented at "), "{message}"); + } +} From 0fc375d2a660843ba8394e1c26a3ac9924414c79 Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:18:05 +0100 Subject: [PATCH 02/12] add example --- Cargo.toml | 2 ++ crates/ohno/examples/unimplemented.rs | 22 ++++++++++++++++++++++ crates/ohno/src/unimplemented.rs | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 crates/ohno/examples/unimplemented.rs diff --git a/Cargo.toml b/Cargo.toml index 5f271f86..e390a9f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,7 +116,9 @@ redundant_type_annotations = "warn" renamed_function_params = "warn" semicolon_outside_block = "warn" string_to_string = "warn" +todo = "deny" undocumented_unsafe_blocks = "warn" +unimplemented = "deny" unnecessary_safety_comment = "warn" unnecessary_safety_doc = "warn" unneeded_field_pattern = "warn" diff --git a/crates/ohno/examples/unimplemented.rs b/crates/ohno/examples/unimplemented.rs new file mode 100644 index 00000000..698da5cc --- /dev/null +++ b/crates/ohno/examples/unimplemented.rs @@ -0,0 +1,22 @@ +use ohno::{unimplemented_error, Unimplemented}; + +#[ohno::error] +#[from(Unimplemented)] +pub struct MyError; + +fn do_something(is_lucky: bool) -> Result<(), MyError> { + if is_lucky { + Ok(()) + } else { + unimplemented_error!("this feature is not yet implemented"); + } +} + +fn main() { + let err = do_something(false).unwrap_err(); + println!("Error: {err}"); +} + +/// Output: +/// Error: not implemented at crates\ohno\examples\unimplemented.rs:11 +/// caused by: this feature is not yet implemented diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 33457856..e3399d54 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -39,10 +39,12 @@ impl Unimplemented { } } + #[must_use] pub fn file(&self) -> &str { &self.file } + #[must_use] pub fn line(&self) -> usize { self.line } From cd7dd6f3244a99955886186aebb6cd3d06139e02 Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:24:52 +0100 Subject: [PATCH 03/12] docs --- crates/ohno/examples/unimplemented.rs | 9 ++-- crates/ohno/src/unimplemented.rs | 64 +++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/crates/ohno/examples/unimplemented.rs b/crates/ohno/examples/unimplemented.rs index 698da5cc..7e01089a 100644 --- a/crates/ohno/examples/unimplemented.rs +++ b/crates/ohno/examples/unimplemented.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use ohno::{unimplemented_error, Unimplemented}; #[ohno::error] @@ -17,6 +20,6 @@ fn main() { println!("Error: {err}"); } -/// Output: -/// Error: not implemented at crates\ohno\examples\unimplemented.rs:11 -/// caused by: this feature is not yet implemented +// Output: +// Error: not implemented at crates\ohno\examples\unimplemented.rs:11 +// caused by: this feature is not yet implemented diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index e3399d54..44249256 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -7,6 +7,21 @@ use std::borrow::Cow; use crate::OhnoCore; +/// Error type for unimplemented functionality. +/// +/// This error type is used to signal that a particular code path or feature +/// has not yet been implemented. It captures the file location and line number +/// where the error was created, along with an optional custom message. +/// +/// # Examples +/// +/// ``` +/// use ohno::Unimplemented; +/// +/// fn not_ready_yet() -> Result<(), Unimplemented> { +/// unimplemented_error!("this feature is coming soon") +/// } +/// ``` #[derive(crate::Error, Clone)] #[no_constructors] #[display("not implemented at {file}:{line}")] @@ -17,6 +32,7 @@ pub struct Unimplemented { } impl Unimplemented { + /// Creates a new `Unimplemented` error. #[must_use] pub fn new(file: Cow<'static, str>, line: usize) -> Self { Self { @@ -26,6 +42,10 @@ impl Unimplemented { } } + /// Creates a new `Unimplemented` error with a custom message. + /// + /// The message provides additional context about why the functionality + /// is not yet implemented or what needs to be done. #[must_use] pub fn with_message( message: impl Into>, @@ -39,17 +59,61 @@ impl Unimplemented { } } + /// Returns the file path where this error was created. #[must_use] pub fn file(&self) -> &str { &self.file } + /// Returns the line number where this error was created. #[must_use] pub fn line(&self) -> usize { self.line } } +/// Returns an `Unimplemented` error from the current function. +/// +/// This macro is a convenient way to signal that a code path has not been +/// implemented yet. It automatically captures the file and line information +/// and returns early with an `Unimplemented` error. +/// +/// The error can be automatically converted into any error type that implements +/// `From`, making it easy to use in functions with different +/// error types. +/// +/// # Examples +/// +/// Basic usage without a message: +/// +/// ```should_panic +/// # use ohno::unimplemented_error; +/// fn future_feature() -> Result { +/// unimplemented_error!() +/// } +/// ``` +/// +/// With a custom message: +/// +/// ```should_panic +/// # use ohno::unimplemented_error; +/// fn experimental_api() -> Result<(), ohno::Unimplemented> { +/// unimplemented_error!("async runtime support not yet available") +/// } +/// ``` +/// +/// Automatic conversion to custom error types: +/// +/// ```should_panic +/// # use ohno::{unimplemented_error, Unimplemented}; +/// #[ohno::error] +/// #[from(Unimplemented)] +/// struct AppError; +/// +/// fn app_function() -> Result<(), AppError> { +/// unimplemented_error!("feature coming in v2.0") +/// } +/// ``` #[macro_export] macro_rules! unimplemented_error { () => { From 1ed65f98813812b4d4758dba2e6b5a3335c9156a Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:35:42 +0100 Subject: [PATCH 04/12] docs --- crates/ohno/src/unimplemented.rs | 34 ++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 44249256..da1c447c 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -9,14 +9,16 @@ use crate::OhnoCore; /// Error type for unimplemented functionality. /// -/// This error type is used to signal that a particular code path or feature -/// has not yet been implemented. It captures the file location and line number -/// where the error was created, along with an optional custom message. +/// This type is designed to replace panicking macros like [`todo!`] and +/// [`unimplemented!`] with a proper error that can be handled gracefully. +/// +/// See the documentation for the [`unimplemented_error!`](crate::unimplemented_error!) macro for +/// more details. /// /// # Examples /// /// ``` -/// use ohno::Unimplemented; +/// use ohno::{Unimplemented, unimplemented_error}; /// /// fn not_ready_yet() -> Result<(), Unimplemented> { /// unimplemented_error!("this feature is coming soon") @@ -72,11 +74,27 @@ impl Unimplemented { } } -/// Returns an `Unimplemented` error from the current function. +/// Returns an [`Unimplemented`] error from the current function. +/// +/// This macro is designed to replace panicking macros like [`todo!`] and +/// [`unimplemented!`] with a proper error that can be handled gracefully. +/// It automatically captures the file and line information and returns early +/// with an `Unimplemented` error. +/// +/// Unlike the standard panicking macros, this allows your application to: /// -/// This macro is a convenient way to signal that a code path has not been -/// implemented yet. It automatically captures the file and line information -/// and returns early with an `Unimplemented` error. +/// - Continue running and handle the error appropriately +/// - Log the error with full context (file, line, message) +/// - Return meaningful error responses to users instead of crashing +/// - Test error paths without triggering panics +/// +/// To prevent accidental use of panicking macros, enable these clippy lints: +/// +/// ```toml +/// [workspace.lints.clippy] +/// todo = "deny" +/// unimplemented = "deny" +/// ``` /// /// The error can be automatically converted into any error type that implements /// `From`, making it easy to use in functions with different From 25e39e389dc4bef783297726f11483f073539d34 Mon Sep 17 00:00:00 2001 From: Vaiz Date: Thu, 27 Nov 2025 11:52:52 +0100 Subject: [PATCH 05/12] Update crates/ohno/src/unimplemented.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- crates/ohno/src/unimplemented.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index da1c447c..4082fee7 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -104,20 +104,21 @@ impl Unimplemented { /// /// Basic usage without a message: /// -/// ```should_panic +/// ``` /// # use ohno::unimplemented_error; /// fn future_feature() -> Result { /// unimplemented_error!() /// } -/// ``` +/// assert!(future_feature().is_err()); /// /// With a custom message: /// -/// ```should_panic +/// ``` /// # use ohno::unimplemented_error; /// fn experimental_api() -> Result<(), ohno::Unimplemented> { /// unimplemented_error!("async runtime support not yet available") /// } +/// assert!(experimental_api().is_err()); /// ``` /// /// Automatic conversion to custom error types: From 489d19616231f91f3b0fe76399c15367e2cd6d6f Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:55:48 +0100 Subject: [PATCH 06/12] clippy --- crates/ohno/examples/unimplemented.rs | 2 ++ crates/ohno/src/unimplemented.rs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/ohno/examples/unimplemented.rs b/crates/ohno/examples/unimplemented.rs index 7e01089a..0eb6263f 100644 --- a/crates/ohno/examples/unimplemented.rs +++ b/crates/ohno/examples/unimplemented.rs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#![expect(clippy::unwrap_used, reason = "example code")] + use ohno::{unimplemented_error, Unimplemented}; #[ohno::error] diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 4082fee7..579a5ad5 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -114,11 +114,11 @@ impl Unimplemented { /// With a custom message: /// /// ``` -/// # use ohno::unimplemented_error; -/// fn experimental_api() -> Result<(), ohno::Unimplemented> { -/// unimplemented_error!("async runtime support not yet available") +/// # use `ohno::unimplemented_error`; +/// fn `experimental_api()` -> Result<(), `ohno::Unimplemented`> { +/// `unimplemented_error!("async` runtime support not yet available") /// } -/// assert!(experimental_api().is_err()); +/// `assert!(experimental_api().is_err())`; /// ``` /// /// Automatic conversion to custom error types: From 60c75195f20122a33a47a38058ba5cb4b7de4cd1 Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:56:16 +0100 Subject: [PATCH 07/12] fmt --- crates/ohno/examples/unimplemented.rs | 2 +- crates/ohno/src/lib.rs | 2 +- crates/ohno/src/unimplemented.rs | 21 ++++----------------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/crates/ohno/examples/unimplemented.rs b/crates/ohno/examples/unimplemented.rs index 0eb6263f..816a7eb5 100644 --- a/crates/ohno/examples/unimplemented.rs +++ b/crates/ohno/examples/unimplemented.rs @@ -3,7 +3,7 @@ #![expect(clippy::unwrap_used, reason = "example code")] -use ohno::{unimplemented_error, Unimplemented}; +use ohno::{Unimplemented, unimplemented_error}; #[ohno::error] #[from(Unimplemented)] diff --git a/crates/ohno/src/lib.rs b/crates/ohno/src/lib.rs index 28553462..51c1dbb0 100644 --- a/crates/ohno/src/lib.rs +++ b/crates/ohno/src/lib.rs @@ -245,4 +245,4 @@ pub use error_ext::ErrorExt; pub use error_trace::{ErrorTrace, ErrorTraceExt}; pub use ohno_macros::{Error, error, error_trace}; pub use trace_info::{Location, TraceInfo}; -pub use unimplemented::Unimplemented; \ No newline at end of file +pub use unimplemented::Unimplemented; diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 579a5ad5..ad567f7c 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -12,7 +12,7 @@ use crate::OhnoCore; /// This type is designed to replace panicking macros like [`todo!`] and /// [`unimplemented!`] with a proper error that can be handled gracefully. /// -/// See the documentation for the [`unimplemented_error!`](crate::unimplemented_error!) macro for +/// See the documentation for the [`unimplemented_error!`](crate::unimplemented_error!) macro for /// more details. /// /// # Examples @@ -49,11 +49,7 @@ impl Unimplemented { /// The message provides additional context about why the functionality /// is not yet implemented or what needs to be done. #[must_use] - pub fn with_message( - message: impl Into>, - file: Cow<'static, str>, - line: usize, - ) -> Self { + pub fn with_message(message: impl Into>, file: Cow<'static, str>, line: usize) -> Self { Self { file, line, @@ -136,19 +132,10 @@ impl Unimplemented { #[macro_export] macro_rules! unimplemented_error { () => { - return Err($crate::Unimplemented::new( - std::borrow::Cow::Borrowed(file!()), - line!() as usize, - ) - .into()) + return Err($crate::Unimplemented::new(std::borrow::Cow::Borrowed(file!()), line!() as usize).into()) }; ($ex:expr) => { - return Err($crate::Unimplemented::with_message( - $ex, - std::borrow::Cow::Borrowed(file!()), - line!() as usize, - ) - .into()) + return Err($crate::Unimplemented::with_message($ex, std::borrow::Cow::Borrowed(file!()), line!() as usize).into()) }; } From e9f32b7675a7e3c65968b2cd06172b11f22363c9 Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:57:44 +0100 Subject: [PATCH 08/12] remove should_panic --- crates/ohno/src/unimplemented.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index ad567f7c..24e3d089 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -119,7 +119,7 @@ impl Unimplemented { /// /// Automatic conversion to custom error types: /// -/// ```should_panic +/// ``` /// # use ohno::{unimplemented_error, Unimplemented}; /// #[ohno::error] /// #[from(Unimplemented)] From c40014c756697163598b8d8710aa93136f1baa5c Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:00:09 +0100 Subject: [PATCH 09/12] fix code blocks --- crates/ohno/src/unimplemented.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 24e3d089..821bb249 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -105,16 +105,15 @@ impl Unimplemented { /// fn future_feature() -> Result { /// unimplemented_error!() /// } -/// assert!(future_feature().is_err()); +/// ``` /// /// With a custom message: /// /// ``` -/// # use `ohno::unimplemented_error`; -/// fn `experimental_api()` -> Result<(), `ohno::Unimplemented`> { -/// `unimplemented_error!("async` runtime support not yet available") +/// # use ohno::unimplemented_error; +/// fn experimental_api() -> Result<(), ohno::Unimplemented> { +/// unimplemented_error!("async runtime support not yet available") /// } -/// `assert!(experimental_api().is_err())`; /// ``` /// /// Automatic conversion to custom error types: From 5592732a701d8b39dc9052171a1483fadb8ae059 Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:37:42 +0100 Subject: [PATCH 10/12] improve coverage --- crates/ohno/src/unimplemented.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 821bb249..222dde75 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -165,6 +165,13 @@ mod test { assert!(message.contains("custom message"), "{message}"); } + #[test] + fn file_and_line() { + let err = Unimplemented::new("file.rs".into(), 111); + assert_eq!(err.file(), "file.rs"); + assert_eq!(err.line(), 111); + } + #[test] fn automatic_conversion() { #[derive(Debug)] From 25eefa7d051c8c9f19e8817ba87347b19a99a82b Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:41:36 +0100 Subject: [PATCH 11/12] use u32 for line --- crates/ohno/src/unimplemented.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 222dde75..702835fa 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -29,14 +29,14 @@ use crate::OhnoCore; #[display("not implemented at {file}:{line}")] pub struct Unimplemented { file: Cow<'static, str>, - line: usize, + line: u32, core: OhnoCore, } impl Unimplemented { /// Creates a new `Unimplemented` error. #[must_use] - pub fn new(file: Cow<'static, str>, line: usize) -> Self { + pub fn new(file: Cow<'static, str>, line: u32) -> Self { Self { file, line, @@ -49,7 +49,7 @@ impl Unimplemented { /// The message provides additional context about why the functionality /// is not yet implemented or what needs to be done. #[must_use] - pub fn with_message(message: impl Into>, file: Cow<'static, str>, line: usize) -> Self { + pub fn with_message(message: impl Into>, file: Cow<'static, str>, line: u32) -> Self { Self { file, line, @@ -131,10 +131,10 @@ impl Unimplemented { #[macro_export] macro_rules! unimplemented_error { () => { - return Err($crate::Unimplemented::new(std::borrow::Cow::Borrowed(file!()), line!() as usize).into()) + return Err($crate::Unimplemented::new(::std::borrow::Cow::Borrowed(file!()), line!()).into()) }; ($ex:expr) => { - return Err($crate::Unimplemented::with_message($ex, std::borrow::Cow::Borrowed(file!()), line!() as usize).into()) + return Err($crate::Unimplemented::with_message($ex, ::std::borrow::Cow::Borrowed(file!()), line!()).into()) }; } From 5198e7d45e340b0cbaca3598a1b416f67810de36 Mon Sep 17 00:00:00 2001 From: Vaiz <4908982+Vaiz@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:48:33 +0100 Subject: [PATCH 12/12] missed one spot --- crates/ohno/src/unimplemented.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ohno/src/unimplemented.rs b/crates/ohno/src/unimplemented.rs index 702835fa..cb73d8c6 100644 --- a/crates/ohno/src/unimplemented.rs +++ b/crates/ohno/src/unimplemented.rs @@ -65,7 +65,7 @@ impl Unimplemented { /// Returns the line number where this error was created. #[must_use] - pub fn line(&self) -> usize { + pub fn line(&self) -> u32 { self.line } }