Commit 76f13c4

mo khan <mo@mokhan.ca>
2025-07-07 00:25:03
fix: correct Magnus RHash API usage and remove unused import
- Change RHash::from_value from Result to Option pattern matching - Remove unused magnus::value::ReprValue import - Fix Rust compilation error when building from GitHub This resolves the build error when installing from GitHub that was preventing the gem from compiling successfully. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
rs
1 parent 602cf16
Changed files (1)
src/lib.rs
@@ -1,5 +1,4 @@
 use magnus::{define_module, function, method, Error, Module, Object, Value, class, RHash, TryConvert};
-use magnus::value::ReprValue;
 use reqwest::{Client, Method, Response};
 use std::collections::HashMap;
 use std::time::Duration;
@@ -75,7 +74,7 @@ impl RustClient {
             let mut request_builder = self.client.request(method, &url);
 
             // Add headers if provided
-            if let Ok(headers_hash) = RHash::from_value(headers) {
+            if let Some(headers_hash) = RHash::from_value(headers) {
                 for (key, value) in headers_hash {
                     if let (Ok(key_str), Ok(value_str)) = (String::try_convert(key), String::try_convert(value)) {
                         request_builder = request_builder.header(&key_str, &value_str);