Credientials -> Credentials

master
Paul Woolcock 6 years ago
parent ade7b16382
commit 4ff27dd049
  1. 4
      src/entities/account.rs
  2. 2
      src/entities/mod.rs
  3. 4
      src/lib.rs

@ -82,14 +82,14 @@ fn string_or_bool<'de, D: Deserializer<'de>>(val: D) -> ::std::result::Result<bo
}) })
} }
pub struct CredientialsBuilder<'a> { pub struct CredentialsBuilder<'a> {
display_name: Option<&'a str>, display_name: Option<&'a str>,
note: Option<&'a str>, note: Option<&'a str>,
avatar: Option<&'a Path>, avatar: Option<&'a Path>,
header: Option<&'a Path>, header: Option<&'a Path>,
} }
impl<'a> CredientialsBuilder<'a> { impl<'a> CredentialsBuilder<'a> {
pub fn into_form(self) -> Result<Form> { pub fn into_form(self) -> Result<Form> {
let mut form = Form::new(); let mut form = Form::new();
macro_rules! add_to_form { macro_rules! add_to_form {

@ -21,7 +21,7 @@ pub mod prelude {
//! structs by adding a glob import to the top of mastodon heavy //! structs by adding a glob import to the top of mastodon heavy
//! modules: //! modules:
pub use super::{ pub use super::{
account::{Account, CredientialsBuilder, Source}, account::{Account, CredentialsBuilder, Source},
attachment::{Attachment, MediaType}, attachment::{Attachment, MediaType},
card::Card, card::Card,
context::Context, context::Context,

@ -229,7 +229,7 @@ pub trait MastodonClient<H: HttpSend = HttpSender> {
fn delete_status(&self, id: u64) -> Result<Empty> { fn delete_status(&self, id: u64) -> Result<Empty> {
unimplemented!("This method was not implemented"); unimplemented!("This method was not implemented");
} }
fn update_credentials(&self, changes: CredientialsBuilder) -> Result<Account> { fn update_credentials(&self, changes: CredentialsBuilder) -> Result<Account> {
unimplemented!("This method was not implemented"); unimplemented!("This method was not implemented");
} }
fn new_status(&self, status: StatusBuilder) -> Result<Status> { fn new_status(&self, status: StatusBuilder) -> Result<Status> {
@ -338,7 +338,7 @@ impl<H: HttpSend> MastodonClient<H> for Mastodon<H> {
(delete) delete_status: "statuses/{}" => Empty, (delete) delete_status: "statuses/{}" => Empty,
} }
fn update_credentials(&self, changes: CredientialsBuilder) -> Result<Account> { fn update_credentials(&self, changes: CredentialsBuilder) -> Result<Account> {
let url = self.route("/api/v1/accounts/update_credentials"); let url = self.route("/api/v1/accounts/update_credentials");
let response = self.send(self.client.patch(&url).multipart(changes.into_form()?))?; let response = self.send(self.client.patch(&url).multipart(changes.into_form()?))?;

Loading…
Cancel
Save