Skip to content

Commit 3a6b499

Browse files
committed
docs: minor improvements
1 parent 0e1ab1a commit 3a6b499

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/std/ascii.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub fn isLower(c: u8) bool {
254254
return inTable(c, tIndex.Lower);
255255
}
256256

257-
/// Returns whether the character has some graphical representation and can be printed.
257+
/// Returns whether the character is printable and has some graphical representation.
258258
/// This also returns `true` for the space character.
259259
/// This is the same as `!isControl(c)`.
260260
pub fn isPrint(c: u8) bool {
@@ -286,7 +286,7 @@ pub fn isUpper(c: u8) bool {
286286
return inTable(c, tIndex.Upper);
287287
}
288288

289-
/// Returns whether the character is a hexadecimal digit. This is case-insensitive.
289+
/// Returns whether the character is a hexadecimal digit. Case-insensitive.
290290
pub fn isHex(c: u8) bool {
291291
return inTable(c, tIndex.Hex);
292292
}
@@ -296,7 +296,7 @@ pub fn isASCII(c: u8) bool {
296296
return c < 128;
297297
}
298298

299-
/// Uppercases the character and returns it as-is if it's already uppercased or not a letter.
299+
/// Uppercases the character and returns it as-is if already uppercase or not a letter.
300300
pub fn toUpper(c: u8) u8 {
301301
if (isLower(c)) {
302302
return c & 0b11011111;
@@ -305,7 +305,7 @@ pub fn toUpper(c: u8) u8 {
305305
}
306306
}
307307

308-
/// Lowercases the character and returns it as-is if it's already lowercased or not a letter.
308+
/// Lowercases the character and returns it as-is if already lowercase or not a letter.
309309
pub fn toLower(c: u8) u8 {
310310
if (isUpper(c)) {
311311
return c | 0b00100000;
@@ -314,7 +314,7 @@ pub fn toLower(c: u8) u8 {
314314
}
315315
}
316316

317-
test "ascii character classes" {
317+
test "ASCII character classes" {
318318
const testing = std.testing;
319319

320320
try testing.expect(!isControl('a'));
@@ -440,7 +440,7 @@ pub fn startsWithIgnoreCase(haystack: []const u8, needle: []const u8) bool {
440440
return if (needle.len > haystack.len) false else eqlIgnoreCase(haystack[0..needle.len], needle);
441441
}
442442

443-
test "ascii.startsWithIgnoreCase" {
443+
test "startsWithIgnoreCase" {
444444
try std.testing.expect(startsWithIgnoreCase("boB", "Bo"));
445445
try std.testing.expect(!startsWithIgnoreCase("Needle in hAyStAcK", "haystack"));
446446
}
@@ -449,7 +449,7 @@ pub fn endsWithIgnoreCase(haystack: []const u8, needle: []const u8) bool {
449449
return if (needle.len > haystack.len) false else eqlIgnoreCase(haystack[haystack.len - needle.len ..], needle);
450450
}
451451

452-
test "ascii.endsWithIgnoreCase" {
452+
test "endsWithIgnoreCase" {
453453
try std.testing.expect(endsWithIgnoreCase("Needle in HaYsTaCk", "haystack"));
454454
try std.testing.expect(!endsWithIgnoreCase("BoB", "Bo"));
455455
}

0 commit comments

Comments
 (0)