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

Simplify code #1

Merged
merged 5 commits into from
Jan 3, 2021
Merged

Simplify code #1

merged 5 commits into from
Jan 3, 2021

Conversation

homeworkprod
Copy link
Contributor

Hey @nim65s,

first of all thanks for putting together this nicely compact piece of code.

I took the liberty to try to make the code arguably even simpler and easier to follow.

Please let me know what you think.

Merges duplicated code.
Avoids explicit setting of JSON content type, handles serialization to
JSON.
Keeps the "happy path" on the function's base indentation level.

Avoids carrying status and return value variables, pre-filled in
anticipation of an error, along.
@nim65s
Copy link
Owner

nim65s commented Jan 3, 2021

I totally like it, thanks !

Especially the web.json_response() part. I don't know how I missed that.

@nim65s nim65s merged commit aad0288 into nim65s:master Jan 3, 2021
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.

None yet

2 participants