Skip to content

Commit b29ab01

Browse files
Add Engine in prelude
1 parent 64bbcc0 commit b29ab01

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ precisely, see the following table.
4040
# 0.21.0-rc.1
4141

4242
- Restore the ability to decode into a slice of precisely the correct length with `Engine.decode_slice_unchecked`.
43+
- Add `Engine` as a `pub use` in `prelude`.
4344

4445
# 0.21.0-beta.2
4546

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! 1. Perhaps one of the preconfigured engines in [engine::general_purpose] will suit, e.g.
44
//! [engine::general_purpose::STANDARD_NO_PAD].
55
//! - These are re-exported in [prelude] with a `BASE64_` prefix for those who prefer to
6-
//! `use ...::prelude::*` or equivalent, e.g. [prelude::BASE64_STANDARD_NO_PAD]
6+
//! `use base64::prelude::*` or equivalent, e.g. [prelude::BASE64_STANDARD_NO_PAD]
77
//! 1. If not, choose which alphabet you want. Most usage will want [alphabet::STANDARD] or [alphabet::URL_SAFE].
88
//! 1. Choose which [Engine] implementation you want. For the moment there is only one: [engine::GeneralPurpose].
99
//! 1. Configure the engine appropriately using the engine's `Config` type.

src/prelude.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
//! # Examples
77
//!
88
//! ```
9-
//! use base64::{Engine as _, prelude::BASE64_STANDARD_NO_PAD};
9+
//! use base64::prelude::{Engine as _, BASE64_STANDARD_NO_PAD};
1010
//!
1111
//! assert_eq!("c29tZSBieXRlcw", &BASE64_STANDARD_NO_PAD.encode(b"some bytes"));
1212
//! ```
13+
14+
pub use crate::engine::Engine;
15+
1316
pub use crate::engine::general_purpose::STANDARD as BASE64_STANDARD;
1417
pub use crate::engine::general_purpose::STANDARD_NO_PAD as BASE64_STANDARD_NO_PAD;
1518
pub use crate::engine::general_purpose::URL_SAFE as BASE64_URL_SAFE;

0 commit comments

Comments
 (0)