Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit 843f5d7

Browse files
author
Jonathan Creekmore
committed
allow the user to type alias Result in their code
Instead of generating functions that assume that Result is unaliased, explicitly reference the ::std::result::Result so that end users can have type aliases for Result that assume a specific error type (like std::io::Result does).
1 parent bb0efb0 commit 843f5d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/human.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ enum Response {
200200
#[macro_export]
201201
macro_rules! render_for_humans {
202202
($this:ident -> []) => {
203-
fn render_for_humans(&self, fmt: &mut $crate::human::Formatter) -> Result<(), $crate::Error> {
203+
fn render_for_humans(&self, fmt: &mut $crate::human::Formatter) -> ::std::result::Result<(), $crate::Error> {
204204
Ok(())
205205
}
206206
};
207207
($self:ident -> [$($item:expr,)*]) => {
208-
fn render_for_humans(&$self, fmt: &mut $crate::human::Formatter) -> Result<(), $crate::Error> {
208+
fn render_for_humans(&$self, fmt: &mut $crate::human::Formatter) -> ::std::result::Result<(), $crate::Error> {
209209
let span = $crate::span!([ $( $item, )* ]);
210210
span.render_for_humans(fmt)?;
211211
Ok(())

src/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ enum Response {
212212
#[macro_export]
213213
macro_rules! render_json {
214214
() => {
215-
fn render_json(&self, fmt: &mut $crate::json::Formatter) -> Result<(), $crate::Error> {
215+
fn render_json(&self, fmt: &mut $crate::json::Formatter) -> ::std::result::Result<(), $crate::Error> {
216216
fmt.write(self)?;
217217
Ok(())
218218
}

0 commit comments

Comments
 (0)