Skip to content

Conversation

@bobrik
Copy link
Contributor

@bobrik bobrik commented Oct 15, 2025

We use try_insert, which was added in v1.1.0:

error[E0599]: no method named `try_insert` found for mutable reference `&mut HeaderMap` in the current scope
--> tonic/src/transport/channel/service/user_agent.rs:44:14
   |
42 |           if let Ok(Some(user_agent)) = req
   |  _______________________________________-
43 | |             .headers_mut()
44 | |             .try_insert(USER_AGENT, self.user_agent.clone())
   | |_____________-^^^^^^^^^^
   |
help: there is a method `insert` with a similar name
   |
44 -             .try_insert(USER_AGENT, self.user_agent.clone())
44 +             .insert(USER_AGENT, self.user_agent.clone())
   |

We use `try_insert`, which was added in v1.1.0:

* hyperium/http#682

```
error[E0599]: no method named `try_insert` found for mutable reference `&mut HeaderMap` in the current scope
  --> tonic/src/transport/channel/service/user_agent.rs:44:14
   |
42 |           if let Ok(Some(user_agent)) = req
   |  _______________________________________-
43 | |             .headers_mut()
44 | |             .try_insert(USER_AGENT, self.user_agent.clone())
   | |_____________-^^^^^^^^^^
   |
help: there is a method `insert` with a similar name
   |
44 -             .try_insert(USER_AGENT, self.user_agent.clone())
44 +             .insert(USER_AGENT, self.user_agent.clone())
   |
```
@tottoto tottoto enabled auto-merge (squash) October 16, 2025 12:55
@tottoto tottoto merged commit a4e6fb5 into hyperium:master Oct 16, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants