Skip to content

Commit

Permalink
follow syn Field struct naming conventions
Browse files Browse the repository at this point in the history
Field -> FieldValue; StructField -> Field
  • Loading branch information
fw-immunant committed Mar 31, 2022
1 parent ab984c7 commit 0147874
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion c2rust-transpile/src/rust_ast/comment_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl traverse::Traversal for CommentTraverser {
reinsert_and_traverse!(traverse_impl_item, ImplItem, traverse::traverse_impl_item_def);
reinsert_and_traverse!(traverse_block, Block, traverse::traverse_block_def);
reinsert_and_traverse!(traverse_local, Local, traverse::traverse_local_def);
reinsert_and_traverse!(traverse_field, Field, traverse::traverse_field_def);
reinsert_and_traverse!(traverse_field, FieldValue, traverse::traverse_field_def);
reinsert_and_traverse!(traverse_item, Item, traverse::traverse_item_def);

fn traverse_foreign_item(&mut self, mut i: ForeignItem) -> ForeignItem {
Expand Down
10 changes: 5 additions & 5 deletions c2rust-transpile/src/translator/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use crate::translator::{ExprContext, Translation, PADDING_SUFFIX};
use crate::with_stmts::WithStmts;
use c2rust_ast_builder::mk;
use c2rust_ast_printer::pprust;
NestedMetaItem, StmtKind, StrStyle, StructField, Ty, TyKind,
use syn::{
self, AttrStyle, BinOp as RBinOp, Expr, Meta,
NestedMeta, Stmt, Field, Type,
ExprBlock, ExprAssign, ExprAssignOp, ExprBinary, ExprUnary, ExprMethodCall, ExprCast,
};
use syntax::ptr::P;
Expand All @@ -40,7 +40,7 @@ enum FieldType {
Regular {
name: String,
ctype: CTypeId,
field: StructField,
field: Field,
use_inner_type: bool,
},
}
Expand Down Expand Up @@ -278,7 +278,7 @@ impl<'a> Translation<'a> {
struct_id: CRecordId,
field_ids: &[CDeclId],
platform_byte_size: u64,
) -> Result<Vec<StructField>, TranslationError> {
) -> Result<Vec<Field>, TranslationError> {
let mut field_entries = Vec::with_capacity(field_ids.len());
// We need to clobber bitfields in consecutive bytes together (leaving
// regular fields alone) and add in padding as necessary
Expand Down Expand Up @@ -534,7 +534,7 @@ impl<'a> Translation<'a> {

fields
.into_iter()
.collect::<WithStmts<Vec<ast::Field>>>()
.collect::<WithStmts<Vec<syn::FieldValue>>>()
.and_then(|fields| {
let struct_expr = mk().struct_expr(name.as_str(), fields);
let local_variable =
Expand Down Expand Up @@ -649,7 +649,7 @@ impl<'a> Translation<'a> {

Ok(fields
.into_iter()
.collect::<WithStmts<Vec<ast::Field>>>()
.collect::<WithStmts<Vec<syn::FieldValue>>>()
.map(|fields| mk().struct_expr(name.as_str(), fields)))
}

Expand Down

0 comments on commit 0147874

Please sign in to comment.