File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -630,7 +630,7 @@ mod test {
630
630
631
631
let rng = & mut ChaChaRng :: from_seed ( Default :: default ( ) ) as & mut dyn CryptoRngCore ;
632
632
let r1 = rng. next_u64 ( ) ;
633
- let rng: & mut dyn RngCore = rng. upcast ( ) ;
633
+ let rng: & mut dyn RngCore = rng. as_rngcore ( ) ;
634
634
let r2 = rng. next_u64 ( ) ;
635
635
assert_ne ! ( r1, r2) ;
636
636
}
Original file line number Diff line number Diff line change @@ -210,14 +210,14 @@ pub trait CryptoRng {}
210
210
211
211
/// An extension trait to support trait objects that implement [`RngCore`] and
212
212
/// [`CryptoRng`]. Upcasting to [`RngCore`] is supported via the
213
- /// [`CryptoRngCore::upcast `] method.
213
+ /// [`CryptoRngCore::as_rngcore `] method.
214
214
pub trait CryptoRngCore : RngCore {
215
215
/// Upcast to an [`RngCore`] trait object.
216
- fn upcast ( & mut self ) -> & mut dyn RngCore ;
216
+ fn as_rngcore ( & mut self ) -> & mut dyn RngCore ;
217
217
}
218
218
219
219
impl < T : CryptoRng + RngCore > CryptoRngCore for T {
220
- fn upcast ( & mut self ) -> & mut dyn RngCore {
220
+ fn as_rngcore ( & mut self ) -> & mut dyn RngCore {
221
221
self
222
222
}
223
223
}
You can’t perform that action at this time.
0 commit comments