@@ -624,7 +624,7 @@ fn capture_handler(error: &(dyn StdError + 'static)) -> Box<dyn EyreHandler> {
624
624
}
625
625
626
626
impl dyn EyreHandler {
627
- /// Returns true if the handler is of the specified type
627
+ /// Check if the handler is of type `T`
628
628
pub fn is < T : EyreHandler > ( & self ) -> bool {
629
629
// Get `TypeId` of the type this function is instantiated with.
630
630
let t = core:: any:: TypeId :: of :: < T > ( ) ;
@@ -1130,21 +1130,6 @@ pub trait WrapErr<T, E>: context::private::Sealed {
1130
1130
where
1131
1131
D : Display + Send + Sync + ' static ,
1132
1132
F : FnOnce ( ) -> D ;
1133
-
1134
- /// Compatibility re-export of wrap_err for interop with `anyhow`
1135
- #[ cfg( feature = "anyhow" ) ]
1136
- #[ cfg_attr( track_caller, track_caller) ]
1137
- fn context < D > ( self , msg : D ) -> Result < T , Report >
1138
- where
1139
- D : Display + Send + Sync + ' static ;
1140
-
1141
- /// Compatibility re-export of wrap_err_with for interop with `anyhow`
1142
- #[ cfg( feature = "anyhow" ) ]
1143
- #[ cfg_attr( track_caller, track_caller) ]
1144
- fn with_context < D , F > ( self , f : F ) -> Result < T , Report >
1145
- where
1146
- D : Display + Send + Sync + ' static ,
1147
- F : FnOnce ( ) -> D ;
1148
1133
}
1149
1134
1150
1135
/// Provides the [`ok_or_eyre`][OptionExt::ok_or_eyre] method for [`Option`].
@@ -1202,7 +1187,8 @@ pub trait OptionExt<T>: context::private::Sealed {
1202
1187
M : Debug + Display + Send + Sync + ' static ;
1203
1188
}
1204
1189
1205
- /// Provides the `context` method for `Option` when porting from `anyhow`
1190
+ /// Provides the `context` and `with_context` methods for `Result` and `Option` to enhance
1191
+ /// compatibility when porting from anyhow.
1206
1192
///
1207
1193
/// This trait is sealed and cannot be implemented for types outside of
1208
1194
/// `eyre`.
@@ -1261,19 +1247,6 @@ pub trait ContextCompat<T>: context::private::Sealed {
1261
1247
where
1262
1248
D : Display + Send + Sync + ' static ,
1263
1249
F : FnOnce ( ) -> D ;
1264
-
1265
- /// Compatibility re-export of `context` for porting from `anyhow` to `eyre`
1266
- #[ cfg_attr( track_caller, track_caller) ]
1267
- fn wrap_err < D > ( self , msg : D ) -> Result < T , Report >
1268
- where
1269
- D : Display + Send + Sync + ' static ;
1270
-
1271
- /// Compatibility re-export of `with_context` for porting from `anyhow` to `eyre`
1272
- #[ cfg_attr( track_caller, track_caller) ]
1273
- fn wrap_err_with < D , F > ( self , f : F ) -> Result < T , Report >
1274
- where
1275
- D : Display + Send + Sync + ' static ,
1276
- F : FnOnce ( ) -> D ;
1277
1250
}
1278
1251
1279
1252
/// Equivalent to `Ok::<_, eyre::Error>(value)`.
0 commit comments