5555#[ macro_export]
5656macro_rules! bail {
5757 ( $msg: literal $( , ) ?) => {
58- return $crate:: private :: Err ( $crate:: __anyhow!( $msg) )
58+ return $crate:: __private :: Err ( $crate:: __anyhow!( $msg) )
5959 } ;
6060 ( $err: expr $( , ) ?) => {
61- return $crate:: private :: Err ( $crate:: __anyhow!( $err) )
61+ return $crate:: __private :: Err ( $crate:: __anyhow!( $err) )
6262 } ;
6363 ( $fmt: expr, $( $arg: tt) * ) => {
64- return $crate:: private :: Err ( $crate:: __anyhow!( $fmt, $( $arg) * ) )
64+ return $crate:: __private :: Err ( $crate:: __anyhow!( $fmt, $( $arg) * ) )
6565 } ;
6666}
6767
@@ -120,24 +120,24 @@ macro_rules! bail {
120120macro_rules! ensure {
121121 ( $cond: expr $( , ) ?) => {
122122 if !$cond {
123- return $crate:: private :: Err ( $crate:: Error :: msg(
124- $crate:: private :: concat!( "Condition failed: `" , $crate:: private :: stringify!( $cond) , "`" )
123+ return $crate:: __private :: Err ( $crate:: Error :: msg(
124+ $crate:: __private :: concat!( "Condition failed: `" , $crate:: __private :: stringify!( $cond) , "`" )
125125 ) ) ;
126126 }
127127 } ;
128128 ( $cond: expr, $msg: literal $( , ) ?) => {
129129 if !$cond {
130- return $crate:: private :: Err ( $crate:: __anyhow!( $msg) ) ;
130+ return $crate:: __private :: Err ( $crate:: __anyhow!( $msg) ) ;
131131 }
132132 } ;
133133 ( $cond: expr, $err: expr $( , ) ?) => {
134134 if !$cond {
135- return $crate:: private :: Err ( $crate:: __anyhow!( $err) ) ;
135+ return $crate:: __private :: Err ( $crate:: __anyhow!( $err) ) ;
136136 }
137137 } ;
138138 ( $cond: expr, $fmt: expr, $( $arg: tt) * ) => {
139139 if !$cond {
140- return $crate:: private :: Err ( $crate:: __anyhow!( $fmt, $( $arg) * ) ) ;
140+ return $crate:: __private :: Err ( $crate:: __anyhow!( $fmt, $( $arg) * ) ) ;
141141 }
142142 } ;
143143}
@@ -189,22 +189,22 @@ macro_rules! ensure {
189189#[ macro_export]
190190macro_rules! anyhow {
191191 ( $msg: literal $( , ) ?) => {
192- $crate:: private :: must_use( {
193- let error = $crate:: private :: format_err( $crate:: private :: format_args!( $msg) ) ;
192+ $crate:: __private :: must_use( {
193+ let error = $crate:: __private :: format_err( $crate:: __private :: format_args!( $msg) ) ;
194194 error
195195 } )
196196 } ;
197197 ( $err: expr $( , ) ?) => {
198- $crate:: private :: must_use( {
199- use $crate:: private :: kind:: * ;
198+ $crate:: __private :: must_use( {
199+ use $crate:: __private :: kind:: * ;
200200 let error = match $err {
201201 error => ( & error) . anyhow_kind( ) . new( error) ,
202202 } ;
203203 error
204204 } )
205205 } ;
206206 ( $fmt: expr, $( $arg: tt) * ) => {
207- $crate:: Error :: msg( $crate:: private :: format!( $fmt, $( $arg) * ) )
207+ $crate:: Error :: msg( $crate:: __private :: format!( $fmt, $( $arg) * ) )
208208 } ;
209209}
210210
@@ -215,17 +215,17 @@ macro_rules! anyhow {
215215#[ macro_export]
216216macro_rules! __anyhow {
217217 ( $msg: literal $( , ) ?) => ( {
218- let error = $crate:: private :: format_err( $crate:: private :: format_args!( $msg) ) ;
218+ let error = $crate:: __private :: format_err( $crate:: __private :: format_args!( $msg) ) ;
219219 error
220220 } ) ;
221221 ( $err: expr $( , ) ?) => ( {
222- use $crate:: private :: kind:: * ;
222+ use $crate:: __private :: kind:: * ;
223223 let error = match $err {
224224 error => ( & error) . anyhow_kind( ) . new( error) ,
225225 } ;
226226 error
227227 } ) ;
228228 ( $fmt: expr, $( $arg: tt) * ) => {
229- $crate:: Error :: msg( $crate:: private :: format!( $fmt, $( $arg) * ) )
229+ $crate:: Error :: msg( $crate:: __private :: format!( $fmt, $( $arg) * ) )
230230 } ;
231231}
0 commit comments