Skip to content

Commit b59e4ea

Browse files
Add migration info
1 parent 7434186 commit b59e4ea

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

RELEASE-NOTES.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,53 @@
11
# 0.20.1
22

3-
### Breaking changes
3+
## Breaking changes
44

55
- `FastPortable` was only meant to be an interim name, and shouldn't have shipped in 0.20. It is now `GeneralPurpose` to
66
make its intended usage more clear.
77
- `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.
911
- `encode*` and `decode*` top level functions are now methods on `Engine`.
1012
- `DEFAULT_ENGINE` was replaced by `engine::general_purpose::STANDARD`
1113
- 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 |
1347

1448
# 0.20.0
1549

16-
### Breaking changes
50+
## Breaking changes
1751

1852
- Update MSRV to 1.57.0
1953
- Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require

0 commit comments

Comments
 (0)