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 #6

Merged
merged 3 commits into from
Dec 20, 2021
Merged

Refactor #6

merged 3 commits into from
Dec 20, 2021

Conversation

emreyalvac
Copy link
Owner

No description provided.

@emreyalvac
Copy link
Owner Author

@dorfsmay @y2kappa @bobbbay

Hi,

Can u review please :)

@emreyalvac emreyalvac merged commit 508f76d into master Dec 20, 2021
Copy link

@bobbbay bobbbay left a comment

Choose a reason for hiding this comment

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

In case you're still looking for a code review, I've added a few comments here.

Comment on lines +3 to +8
#[derive(Debug)]
pub enum UrlParseError {
NoPath,
NotHttps,
Parser(url::ParseError),
}
Copy link

Choose a reason for hiding this comment

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

Do you really need this, or does url's ParseError cover everything? It seems to me that it does: https://docs.rs/url/latest/url/enum.ParseError.html#variants

Comment on lines +12 to +14
if uri.scheme() != "https" {
return Err(UrlParseError::NotHttps);
}
Copy link

Choose a reason for hiding this comment

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

What's the reasoning behind mandating https? If Firebase has a problem with http, it should probably be reported from their side, not manually from the library.

use std::fmt::{Display, Formatter};

#[derive(Debug)]
pub enum UrlParseError {
Copy link

Choose a reason for hiding this comment

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

You should create a type alias to Result<T, UrlParseError> and use it instead, e.g. in src/utils.rs' check_uri function.

}

#[derive(Debug)]
pub enum RequestError {
Copy link

Choose a reason for hiding this comment

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

The same comment regarding a custom Result type goes for here.

Comment on lines -1 to -3
/*
Firebase REST API
*/
Copy link

Choose a reason for hiding this comment

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

This top-level crate documentation was a great idea. Maybe not in this PR, but eventually I highly recommend writing doc comments for everything, including top-level module documentation.

@emreyalvac emreyalvac deleted the refactor branch July 9, 2023 18:24
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