Skip to content

Commit

Permalink
Fix clippy empty_structs_with_brackets (#190)
Browse files Browse the repository at this point in the history
* Fix clippy empty_structs_with_brackets

* Add docs to keep deepsource happy
  • Loading branch information
jayvdb authored Feb 11, 2024
1 parent 88e606b commit 820df4a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
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

0 comments on commit 820df4a

Please sign in to comment.