|
1 | 1 | # 0.20.1
|
2 | 2 |
|
3 |
| -### Breaking changes |
| 3 | +## Breaking changes |
4 | 4 |
|
5 | 5 | - `FastPortable` was only meant to be an interim name, and shouldn't have shipped in 0.20. It is now `GeneralPurpose` to
|
6 | 6 | make its intended usage more clear.
|
7 | 7 | - `GeneralPurpose` and its config are now `pub use`'d in the `engine` module for convenience.
|
8 |
| -- Change a few `from()` functions to be `new()`. `from()` causes confusing compiler errors because of confusion with `From::from`, and is a little misleading because some of those invocations are not very cheap as one would usually expect from a `from` call. |
| 8 | +- Change a few `from()` functions to be `new()`. `from()` causes confusing compiler errors because of confusion |
| 9 | + with `From::from`, and is a little misleading because some of those invocations are not very cheap as one would |
| 10 | + usually expect from a `from` call. |
9 | 11 | - `encode*` and `decode*` top level functions are now methods on `Engine`.
|
10 | 12 | - `DEFAULT_ENGINE` was replaced by `engine::general_purpose::STANDARD`
|
11 | 13 | - Predefined engine consts `engine::general_purpose::{STANDARD, URL_SAFE, URL_SAFE_NO_PAD}`
|
12 |
| - - These are `pub use`d into `engine` as well |
| 14 | + - These are `pub use`d into `engine` as well |
| 15 | + |
| 16 | +## Migration |
| 17 | + |
| 18 | +### Functions |
| 19 | + |
| 20 | +| < 0.20 function | 0.21 equivalent | |
| 21 | +|-------------------------|-----------------------------| |
| 22 | +| `encode()` | `engine::STANDARD.encode()` | |
| 23 | +| `encode_config()` | `engine.encode()` | |
| 24 | +| `encode_config_buf()` | `engine.encode_string()` | |
| 25 | +| `encode_config_slice()` | `engine.encode_slice()` | |
| 26 | +| `decode()` | `engine::STANDARD.decode()` | |
| 27 | +| `decode_config()` | `engine.decode()` | |
| 28 | +| `decode_config_buf()` | `engine.decode_vec()` | |
| 29 | +| `decode_config_slice()` | `engine.decode_slice()` | |
| 30 | + |
| 31 | +The short-lived 0.20 functions were the 0.13 functions with `config` replaced with `engine`. |
| 32 | + |
| 33 | +### Padding |
| 34 | + |
| 35 | +Where possible, use `engine::STANDARD`, `engine::URL_SAFE`, or `engine::URL_SAFE_NO_PAD`. The first two requires that |
| 36 | +canonical padding is present when decoding, and the last requires that padding is absent. |
| 37 | + |
| 38 | +If you need the < 0.20 behavior that did not care about padding, or want to recreate < 0.20.0's predefined `Config`s |
| 39 | +precisely, see the following table. |
| 40 | + |
| 41 | +| 0.13.1 Config | 0.20.0+ alphabet | `encode_padding` | `decode_padding_mode` | |
| 42 | +|-----------------|------------------|------------------|-----------------------| |
| 43 | +| STANDARD | STANDARD | true | Indifferent | |
| 44 | +| STANDARD_NO_PAD | STANDARD | false | Indifferent | |
| 45 | +| URL_SAFE | URL_SAFE | true | Indifferent | |
| 46 | +| URL_SAFE_NO_PAD | URL_SAFE | false | Indifferent | |
13 | 47 |
|
14 | 48 | # 0.20.0
|
15 | 49 |
|
16 |
| -### Breaking changes |
| 50 | +## Breaking changes |
17 | 51 |
|
18 | 52 | - Update MSRV to 1.57.0
|
19 | 53 | - Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require
|
|
0 commit comments