Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit bf4e85e

Browse files
committed
Re-use string.trim_ascii_ws.
1 parent f7088ad commit bf4e85e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/lib/InterpreterConstraints.zig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@ const Release = Version.Release;
66
const PreRelease = Version.PreRelease;
77
const Specifier = @import("Specifier.zig");
88
const Version = @import("Version.zig");
9+
const string = @import("string.zig");
910

1011
const log = std.log.scoped(.ics);
1112

12-
fn trim_ws(value: []const u8) []const u8 {
13-
return std.mem.trim(u8, value, " \t\n\r");
14-
}
15-
1613
const PythonImplementation = enum { CPython, PyPy };
1714

1815
const InterpreterConstraint = struct {
1916
impl: ?PythonImplementation,
2017
specifier: Specifier,
2118

2219
fn parse(allocator: std.mem.Allocator, constraint: []const u8) !InterpreterConstraint {
23-
const trimmed = trim_ws(constraint);
20+
const trimmed = string.trim_ascii_ws(constraint);
2421
var index: usize = 0;
2522
while (index < trimmed.len) {
2623
switch (trimmed[index]) {

0 commit comments

Comments
 (0)