summaryrefslogtreecommitdiffstats
path: root/src/registration.rs
diff options
context:
space:
mode:
authorPaul Woolcock <paul@woolcock.us>2018-08-27 10:28:39 -0400
committerPaul Woolcock <paul@woolcock.us>2018-08-27 11:27:19 -0400
commit1057e58343b64cd621b71d202c8cc36fd5bd80bc (patch)
tree2db27d45244185faf15c63bcb4b0b9e992f7b34c /src/registration.rs
parent009798d17f95437d292954b3f1c87b6f7f109026 (diff)
There's no reason for Registration::complete to take an owned string
Diffstat (limited to 'src/registration.rs')
-rw-r--r--src/registration.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/registration.rs b/src/registration.rs
index a3465c2..30f33b1 100644
--- a/src/registration.rs
+++ b/src/registration.rs
@@ -103,7 +103,7 @@ impl<'a, H: HttpSend> Registration<'a, H> {
/// // Here you now need to open the url in the browser
/// // And handle a the redirect url coming back with the code.
/// let code = String::from("RETURNED_FROM_BROWSER");
- /// let mastodon = registration.complete(code)?;
+ /// let mastodon = registration.complete(&code)?;
///
/// println!("{:?}", mastodon.get_home_timeline()?.initial_items);
/// # Ok(())
@@ -144,7 +144,7 @@ impl<H: HttpSend> Registered<H> {
/// Create an access token from the client id, client secret, and code
/// provided by the authorisation url.
- pub fn complete(self, code: String) -> Result<Mastodon<H>> {
+ pub fn complete(self, code: &str) -> Result<Mastodon<H>> {
let url = format!(
"{}/oauth/token?client_id={}&client_secret={}&code={}&grant_type=authorization_code&redirect_uri={}",
self.base,