Skip to content

Commit ea96c6c

Browse files
committed
docs: clarify u8::is_ascii_whitespace excludes vertical tab
The standard library uses the WhatWG Infra Standard definition of ASCII whitespace, which does not include vertical tab (U+000B). The Rust language parser uses Unicode Pattern_White_Space, which does include it.
1 parent c771f6e commit ea96c6c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

library/core/src/num/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,11 @@ impl u8 {
10731073
/// "field splitting" in the Bourne shell][bfs] considers *only*
10741074
/// SPACE, HORIZONTAL TAB, and LINE FEED as whitespace.
10751075
///
1076+
/// Note: The Rust language parser uses a different definition of
1077+
/// whitespace, which includes U+000B VERTICAL TAB. The Rust standard
1078+
/// library (this function) does **not** include vertical tab, following
1079+
/// the WhatWG Infra Standard instead.
1080+
///
10761081
/// If you are writing a program that will process an existing
10771082
/// file format, check what that format's definition of whitespace is
10781083
/// before using this function.

0 commit comments

Comments
 (0)