MCPcopy Index your code
hub / github.com/SoftbearStudios/bitcode / field_name

Function field_name

bitcode_derive/src/shared.rs:171–183  ·  view source on GitHub ↗
(i: usize, field: &Field, real: bool)

Source from the content-addressed store, hash-verified

169}
170
171fn field_name(i: usize, field: &Field, real: bool) -> TokenStream {
172 field
173 .ident
174 .as_ref()
175 .map(|id| quote! {#id})
176 .unwrap_or_else(|| {
177 if real {
178 Index::from(i).to_token_stream()
179 } else {
180 Ident::new(&format!("f{i}"), Span::call_site()).to_token_stream()
181 }
182 })
183}
184
185pub fn remove_lifetimes(generics: &mut Generics) {
186 generics.params = std::mem::take(&mut generics.params)

Callers 2

field_implsMethod · 0.85
destructure_fieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected