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

refactor(sqlite): fix some warnings #26

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

open-schnick
Copy link
Contributor

No description provided.

sql::Statement::Update(u) if u.pre_condition.is_some() => false,
_ => true,
};
let exec = !matches!(sql, sql::Statement::Update(u) if u.pre_condition.is_some());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe one could rename the variable to make it express the actual meaning behind not executing the query in some cases

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually i am not really sure what the code means ^^
we dont exec when the sql is not an Statement::Update or an Statement::Update without a pre_condition
renaming exec to something more meaningful would make the code more readable i think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When exec is true, call stmt.execute. When exec is false, call stmt.query). (i.e true is call the execute method).

@open-schnick open-schnick force-pushed the refactor/fix-warnings branch from 5d3074a to 50bb545 Compare October 26, 2024 10:03
@carllerche carllerche merged commit 4efcd05 into tokio-rs:main Oct 29, 2024
3 checks passed
@open-schnick open-schnick deleted the refactor/fix-warnings branch October 30, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants