GeezerVison is showing github.com — docs: correct current Rust limitations (#1029) · jdx/usage@6792f6d
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: derive/src/lib.rs +4-11Lines changed: 4 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
293 | 293 | //! |
294 | 294 | //! A word is held as the bytes it arrived as and converted once, where the struct is built. |
295 | 295 | //! So a value that is not valid UTF-8 is **reported** rather than quietly replaced with |
296 | | -//! `U+FFFD` — which for a `PathBuf` meant a different file, silently. What is still missing |
297 | | -//! is *accepting* such a value: recovering an `OsString` from those bytes needs |
298 | | -//! `OsStr::from_encoded_bytes_unchecked`, which is `unsafe`, and this crate has none. |
| 296 | +//! `U+FFFD` — which for a `PathBuf` meant a different file, silently. On Unix, `PathBuf` and |
| 297 | +//! `OsString` fields accept the bytes exactly through the safe `OsStringExt::from_vec`; on |
| 298 | +//! Windows, a value that cannot be converted safely is reported rather than reconstructed with |
| 299 | +//! `OsString::from_encoded_bytes_unchecked`. |
299 | 300 | //! |
300 | | -//! # What this version does not do |
301 | | -//! |
302 | | -//! Published early on purpose, so it can be used and argued with — but these are |
303 | | -//! real limits, not omissions from the docs. |
304 | | -//! |
305 | | -//! - **Flattening.** A struct cannot yet borrow another struct's flags, so a set of |
306 | | -//! options shared by several commands has to be repeated. |
307 | | -
|
308 | 301 | use proc_macro::TokenStream; |
309 | 302 | use syn::{parse_macro_input, DeriveInput}; |
310 | 303 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: docs/rust/index.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -151,6 +151,6 @@ equivalent yet: |
151 | 151 | - There is no per-field `value_parser`-style validation — values are built with `FromStr`, and a |
152 | 152 | conversion failure becomes an `InvalidValue` error. |
153 | 153 | - Prefix matching (`infer_long_args`) is suggested in error messages but never accepted. |
154 | | -- Non-UTF-8 argv values are reported precisely in errors rather than lossily replaced, but cannot |
155 | | - currently be _accepted_ into fields (the crates forbid the `unsafe` needed to reconstruct an |
156 | | - `OsString`). |
| 154 | +- On Unix, `PathBuf` and `OsString` fields accept non-UTF-8 argv without changing a byte. String |
| 155 | + fields still report invalid UTF-8 precisely rather than replacing it; on Windows, values that |
| 156 | + cannot be converted safely are reported instead of using an unchecked reconstruction. |
Collapse file
Copy file name to clipboardExpand all lines: docs/spec/integrations/clap.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
6 | 6 |
|
7 | 7 | ```toml |
8 | 8 | [dependencies] |
9 | | -clap_usage = "2" |
| 9 | +clap_usage = "5" |
10 | 10 | ``` |
11 | 11 |
|
12 | 12 | ## Quick Start |
|