-
Notifications
You must be signed in to change notification settings - Fork 3
Add Login and URL Tests #46
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
Conversation
} | ||
} | ||
|
||
impl TryFrom<WPRestAPIURL> for url::Url { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we want to make this a recoverable error – providing an invalid URL is a programmer error, so this should probably panic instead? But a server could also provide an invalid URL and that's not the user's fault.
Interested to hear y'alls thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be a none issue if WPRestAPIURL
is guaranteed to be a valid URL, right? We can un-pub
WPRestAPIURL.string_value
and use a WPRestAPIURL::from_str() -> Result<WPRestAPIURL, UrlParsingError>
function as the only function to create a WPRestAPIURL
instance?
}; | ||
} | ||
|
||
builder.build() //.map_err(|err| UrlParsingError::InvalidUrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the previous implementation using fold is cleaner. The build
function body can be merged into this function here.
} | ||
} | ||
|
||
impl TryFrom<WPRestAPIURL> for url::Url { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be a none issue if WPRestAPIURL
is guaranteed to be a valid URL, right? We can un-pub
WPRestAPIURL.string_value
and use a WPRestAPIURL::from_str() -> Result<WPRestAPIURL, UrlParsingError>
function as the only function to create a WPRestAPIURL
instance?
extension OAuthResponseUrl { | ||
static func new(stringValue: String) -> OAuthResponseUrl { | ||
OAuthResponseUrl(stringValue: stringValue) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find any caller to this function. Can it be deleted?
Replaced by #163 – closing |
Adds tests (and types) that were missing from #44, including:
WPAPIApplicationPasswordDetailsBuilder
for parsing the OAuth URLWPRestAPIURL
handling