Skip to content

Commit 099f11f

Browse files
committed
Remove allow(bare_trait_objects)
Clippy emits: warning: trait objects without an explicit `dyn` are deprecated We are currently configuring the linter to allow this but it is not necessary. Use `dyn` as suggested by the linter and remove `allow(bare_trait_objects)`.
1 parent 4299575 commit 099f11f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ assert_eq!(variant, Variant::Bech32);
2929
)]
3030
//!
3131
32-
// Allow trait objects without dyn on nightly.
33-
#![allow(bare_trait_objects)]
3432
#![deny(missing_docs)]
3533
#![deny(non_upper_case_globals)]
3634
#![deny(non_camel_case_types)]
@@ -171,7 +169,7 @@ const CHECKSUM_LENGTH: usize = 6;
171169
/// Allocationless Bech32 writer that accumulates the checksum data internally and writes them out
172170
/// in the end.
173171
pub struct Bech32Writer<'a> {
174-
formatter: &'a mut fmt::Write,
172+
formatter: &'a mut dyn fmt::Write,
175173
chk: u32,
176174
variant: Variant,
177175
}
@@ -184,7 +182,7 @@ impl<'a> Bech32Writer<'a> {
184182
pub fn new(
185183
hrp: &str,
186184
variant: Variant,
187-
fmt: &'a mut fmt::Write,
185+
fmt: &'a mut dyn fmt::Write,
188186
) -> Result<Bech32Writer<'a>, fmt::Error> {
189187
let mut writer = Bech32Writer { formatter: fmt, chk: 1, variant };
190188

@@ -511,7 +509,7 @@ fn check_hrp(hrp: &str) -> Result<Case, Error> {
511509
/// * No length limits are enforced for the data part
512510
#[cfg(feature = "alloc")]
513511
pub fn encode_to_fmt<T: AsRef<[u5]>>(
514-
fmt: &mut fmt::Write,
512+
fmt: &mut dyn fmt::Write,
515513
hrp: &str,
516514
data: T,
517515
variant: Variant,
@@ -529,7 +527,7 @@ pub fn encode_to_fmt<T: AsRef<[u5]>>(
529527
///
530528
/// See `encode_to_fmt` for meaning of errors.
531529
pub fn encode_to_fmt_anycase<T: AsRef<[u5]>>(
532-
fmt: &mut fmt::Write,
530+
fmt: &mut dyn fmt::Write,
533531
hrp: &str,
534532
data: T,
535533
variant: Variant,
@@ -553,7 +551,7 @@ pub fn encode_to_fmt_anycase<T: AsRef<[u5]>>(
553551
/// # Deviations from standard
554552
/// * No length limits are enforced for the data part
555553
pub fn encode_without_checksum_to_fmt<T: AsRef<[u5]>>(
556-
fmt: &mut fmt::Write,
554+
fmt: &mut dyn fmt::Write,
557555
hrp: &str,
558556
data: T,
559557
) -> Result<fmt::Result, Error> {

0 commit comments

Comments
 (0)