diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-06 18:25:03 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-06 18:25:03 -0600 |
| commit | 76f13c4c4d6da6c0bb2adfcec011124a48dd5af6 (patch) | |
| tree | 02acea16f0b49775dbe6508afe09c36161dad456 /src/lib.rs | |
| parent | 602cf1603e6be9e961e5512ca770f6765fcb9b91 (diff) | |
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>
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); |
