Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy empty_structs_with_brackets #190

Merged
merged 2 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions butane_core/src/codegen/dbobj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ fn make_tablelit(config: &Config, tyname: &Ident) -> LitStr {
}
}

/// Help to generate field expressions for each `#[butane::model]`.
pub fn add_fieldexprs(ast_struct: &ItemStruct, config: &Config) -> TokenStream2 {
let tyname = &ast_struct.ident;
let vis = &ast_struct.vis;
Expand All @@ -269,8 +270,7 @@ pub fn add_fieldexprs(ast_struct: &ItemStruct, config: &Config) -> TokenStream2
}
}
/// Helper struct for butane model.
#vis struct #fields_type {
}
#vis struct #fields_type;
impl #fields_type {
#(#fieldexprs)*
}
Expand Down
2 changes: 1 addition & 1 deletion butane_core/src/db/pg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub const BACKEND_NAME: &str = "pg";

/// Postgres [`Backend`] implementation.
#[derive(Debug, Default)]
pub struct PgBackend {}
pub struct PgBackend;
impl PgBackend {
pub fn new() -> PgBackend {
PgBackend {}
Expand Down
4 changes: 2 additions & 2 deletions butane_core/src/db/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn log_callback(error_code: std::ffi::c_int, message: &str) {

/// SQLite [`Backend`] implementation.
#[derive(Debug, Default)]
pub struct SQLiteBackend {}
pub struct SQLiteBackend;
impl SQLiteBackend {
pub fn new() -> SQLiteBackend {
SQLiteBackend {}
Expand Down Expand Up @@ -728,7 +728,7 @@ pub fn sql_insert_or_update(table: &str, columns: &[Column], pkcol: &Column, w:
}

#[derive(Debug)]
struct SQLitePlaceholderSource {}
struct SQLitePlaceholderSource;
impl SQLitePlaceholderSource {
fn new() -> Self {
SQLitePlaceholderSource {}
Expand Down
3 changes: 2 additions & 1 deletion butane_core/src/migrations/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ pub trait Filesystem: Debug {
fn read(&self, path: &Path) -> std::io::Result<Box<dyn Read>>;
}

/// `[Filesystem`] implementation using [`std::fs`].
#[derive(Debug)]
pub struct OsFilesystem {}
pub struct OsFilesystem;

impl Filesystem for OsFilesystem {
fn ensure_dir(&self, path: &Path) -> std::io::Result<()> {
Expand Down
Loading