Skip to content

Commit 2b18a91

Browse files
CodingAnarchyclaude
andcommitted
fix: Fix hammerwork-web compilation error on Linux systems v1.7.3
- Fixed type mismatch in memory usage detection for system metrics - Changed pattern matching from Ok(kb) to Some(kb) for proper Option handling - Added .ok() conversion to handle Result to Option conversion in parse::<u64>() This resolves the production deployment compilation error on Linux platforms. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d628440 commit 2b18a91

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

hammerwork-web/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.7.3] - 2025-07-05
11+
12+
### Fixed
13+
- Fixed compilation error on Linux systems in memory usage detection for system metrics
14+
- Changed pattern matching from `Ok(kb)` to `Some(kb)` for Option type
15+
- Added `.ok()` conversion after `parse::<u64>()` to properly handle Result to Option conversion
16+
1017
## [1.5.0] - 2025-07-02
1118

1219
### Added

hammerwork-web/src/api/system.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ fn get_memory_usage() -> Option<u64> {
433433
if let Ok(contents) = fs::read_to_string("/proc/self/status") {
434434
for line in contents.lines() {
435435
if line.starts_with("VmRSS:") {
436-
if let Ok(kb) = line
436+
if let Some(kb) = line
437437
.split_whitespace()
438438
.nth(1)
439-
.and_then(|s| s.parse::<u64>())
439+
.and_then(|s| s.parse::<u64>().ok())
440440
{
441441
return Some(kb * 1024); // Convert KB to bytes
442442
}

0 commit comments

Comments
 (0)