Skip to content

Commit

Permalink
fix(code): add ending new-line to generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Oct 30, 2023
1 parent a8678c5 commit 77ce422
Show file tree
Hide file tree
Showing 29 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,5 +629,5 @@ pub fn generate_for_table(table: &ParsedTableMacro, config: &GenerationConfig) -
};
let imports = build_imports(table, config);

format!("{FILE_SIGNATURE}\n\n{imports}\n\n{structs}\n{functions}")
format!("{FILE_SIGNATURE}\n\n{imports}\n\n{structs}\n{functions}\n")
}
2 changes: 1 addition & 1 deletion test/autogenerated_all/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/autogenerated_attributes/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/autogenerated_primary_keys/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/cleanup_generated_content/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/create_update_str_cow/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ impl Todos {
diesel::delete(todos.filter(text.eq(param_text))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/create_update_str_str/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ impl Todos {
diesel::delete(todos.filter(text.eq(param_text))).execute(db)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ impl TableA {
diesel::delete(tableA.filter(_id.eq(param__id))).execute(db)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ impl TableB {
diesel::delete(tableB.filter(_id.eq(param__id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/custom_model_path/models/tableA/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ impl TableA {
diesel::delete(tableA.filter(_id.eq(param__id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/custom_model_path/models/tableB/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ impl TableB {
diesel::delete(tableB.filter(_id.eq(param__id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/manual_primary_keys/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/multiple_primary_keys/models/users/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ impl Users {
diesel::delete(users.filter(name.eq(param_name)).filter(address.eq(param_address))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/once_common_structs/models/table1/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ impl Table1 {
diesel::delete(table1.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/once_common_structs/models/table2/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ impl Table2 {
diesel::delete(table2.filter(id.eq(param_id))).execute(db)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ impl Table1 {
diesel::delete(table1.filter(id.eq(param_id))).execute(db)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ impl Table2 {
diesel::delete(table2.filter(id.eq(param_id))).execute(db)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ impl Table1 {
diesel::delete(table1.filter(id.eq(param_id))).execute(db)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ impl Table2 {
diesel::delete(table2.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/once_connection_type/models/table1/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ impl Table1 {
diesel::delete(table1.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/once_connection_type/models/table2/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ impl Table2 {
diesel::delete(table2.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/simple_table/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/simple_table_async/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db).await
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
1 change: 1 addition & 0 deletions test/simple_table_no_crud/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ pub struct UpdateTodos {
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}


2 changes: 1 addition & 1 deletion test/simple_table_no_serde/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ impl Todos {
diesel::delete(todos.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/single_model_file/models/table1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ impl Table1 {
diesel::delete(table1.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/single_model_file/models/table2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ impl Table2 {
diesel::delete(table2.filter(id.eq(param_id))).execute(db)
}

}
}
2 changes: 1 addition & 1 deletion test/use_statements/models/fang_tasks/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ impl FangTasks {
diesel::delete(fang_tasks.filter(id.eq(param_id))).execute(db)
}

}
}

0 comments on commit 77ce422

Please sign in to comment.