MCPcopy Create free account
hub / github.com/dtolnay/thiserror / insert

Method insert

impl/src/generics.rs:61–72  ·  view source on GitHub ↗
(&mut self, ty: impl ToTokens, bound: impl ToTokens)

Source from the content-addressed store, hash-verified

59 }
60
61 pub fn insert(&mut self, ty: impl ToTokens, bound: impl ToTokens) {
62 let ty = ty.to_token_stream();
63 let bound = bound.to_token_stream();
64 let entry = self.bounds.entry(ty.to_string());
65 if let Entry::Vacant(_) = entry {
66 self.order.push(ty);
67 }
68 let (set, tokens) = entry.or_default();
69 if set.insert(bound.to_string()) {
70 tokens.push(bound);
71 }
72 }
73
74 pub fn augment_where_clause(&self, generics: &Generics) -> WhereClause {
75 let mut generics = generics.clone();

Callers 5

expand_shorthandMethod · 0.80
try_explicit_named_argsFunction · 0.80
impl_structFunction · 0.80
impl_enumFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected