diff options
author | D. Scott Boggs <scott@tams.tech> | 2023-02-13 10:46:11 -0500 |
---|---|---|
committer | D. Scott Boggs <scott@tams.tech> | 2024-04-08 09:26:31 -0400 |
commit | 5c111a90fe4d71d0e977276304673e4d1a250df0 (patch) | |
tree | 9bf51fb99e6cc3b3610fd090d35548ec8e5b445e | |
parent | 57f747d427ad8f1a5783a97ade405fd28f807ae6 (diff) |
Fix imports after prelude revisions
-rw-r--r-- | entities/src/auth/scopes.rs | 6 | ||||
-rw-r--r-- | examples/follow_profile.rs | 3 | ||||
-rw-r--r-- | examples/post_status.rs | 3 | ||||
-rw-r--r-- | examples/register/mod.rs | 2 | ||||
-rw-r--r-- | examples/upload_photo.rs | 2 | ||||
-rw-r--r-- | src/apps.rs | 2 | ||||
-rw-r--r-- | src/mastodon.rs | 13 | ||||
-rw-r--r-- | src/registration.rs | 4 |
8 files changed, 19 insertions, 16 deletions
diff --git a/entities/src/auth/scopes.rs b/entities/src/auth/scopes.rs index 8ac5f31..9df846b 100644 --- a/entities/src/auth/scopes.rs +++ b/entities/src/auth/scopes.rs @@ -22,9 +22,9 @@ use serde::{ /// ```rust /// use mastodon_async_entities::prelude::*; /// -/// let read = auth::Scopes::read_all(); -/// let write = auth::Scopes::write_all(); -/// let follow = auth::Scopes::follow(); +/// let read = Scopes::read_all(); +/// let write = Scopes::write_all(); +/// let follow = Scopes::follow(); /// let all = read | write | follow; /// ``` #[derive(Clone)] diff --git a/examples/follow_profile.rs b/examples/follow_profile.rs index 8ee28ac..c54e3cf 100644 --- a/examples/follow_profile.rs +++ b/examples/follow_profile.rs @@ -1,11 +1,10 @@ #![cfg_attr(not(feature = "toml"), allow(dead_code))] #![cfg_attr(not(feature = "toml"), allow(unused_imports))] mod register; -use mastodon_async::Result; +use mastodon_async::{prelude::*, Result}; #[cfg(feature = "toml")] async fn run() -> Result<()> { - use mastodon_async::entities::AccountId; let mastodon = register::get_mastodon_data().await?; let input = register::read_line("Enter the account id you'd like to follow: ")?; let account = AccountId::new(input.trim()); diff --git a/examples/post_status.rs b/examples/post_status.rs index 0b42b60..7b42617 100644 --- a/examples/post_status.rs +++ b/examples/post_status.rs @@ -2,7 +2,8 @@ #![cfg_attr(not(feature = "toml"), allow(unused_imports))] mod register; -use mastodon_async::{Language, Result, StatusBuilder, Visibility}; +use isolang::Language; +use mastodon_async::{prelude::*, Result}; #[cfg(feature = "toml")] async fn run() -> Result<()> { diff --git a/examples/register/mod.rs b/examples/register/mod.rs index 0319c39..d4cb02e 100644 --- a/examples/register/mod.rs +++ b/examples/register/mod.rs @@ -40,7 +40,7 @@ pub async fn register() -> Result<Mastodon> { let website = read_line("Please enter your mastodon instance url:")?; let registration = Registration::new(website.trim()) .client_name("elefren-examples") - .scopes(auth::Scopes::all()) + .scopes(Scopes::all()) .website("https://github.com/dscottboggs/mastodon-async") .build() .await?; diff --git a/examples/upload_photo.rs b/examples/upload_photo.rs index eb4633f..49e5b34 100644 --- a/examples/upload_photo.rs +++ b/examples/upload_photo.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(feature = "toml"), allow(dead_code))] #![cfg_attr(not(feature = "toml"), allow(unused_imports))] mod register; -use mastodon_async::{Result, StatusBuilder, Visibility}; +use mastodon_async::{prelude::*, Result}; #[cfg(feature = "toml")] async fn run() -> Result<()> { diff --git a/src/apps.rs b/src/apps.rs index d71b0f5..a12d06d 100644 --- a/src/apps.rs +++ b/src/apps.rs @@ -48,7 +48,7 @@ impl App { /// builder.client_name("mastodon-async-test"); /// let app = builder.build().unwrap(); /// let scopes = app.scopes(); - /// assert_eq!(scopes, &auth::Scopes::read_all()); + /// assert_eq!(scopes, &Scopes::read_all()); /// ``` pub fn scopes(&self) -> &Scopes { &self.scopes diff --git a/src/mastodon.rs b/src/mastodon.rs index 2747291..e3931d8 100644 --- a/src/mastodon.rs +++ b/src/mastodon.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, ops::Deref, path::Path, sync::Arc}; use crate::{ - entities::{account::Account, prelude::*, report::Report, status::Status, Empty}, + entities::prelude::*, errors::{Error, Result}, helpers::read_response::read_response, polling_time::PollingTime, @@ -9,7 +9,7 @@ use crate::{ }; use futures::TryStream; use log::{debug, error, trace}; -use mastodon_async_entities::{account::CredentialsBuilder, attachment::ProcessedAttachment}; +use mastodon_async_entities::attachment::ProcessedAttachment; use reqwest::{multipart::Part, Client, RequestBuilder}; use url::Url; use uuid::Uuid; @@ -58,8 +58,8 @@ impl Mastodon { (get) mutes: "mutes" => Account, (get) notifications: "notifications" => Notification, (get) instance_peers: "instance/peers" => String, - (get) instance_activity: "instance/activity" => Activity, - (get) instance_rules: "instance/rules" => Rule, + (get) instance_activity: "instance/activity" => instance::Activity, + (get) instance_rules: "instance/rules" => instance::Rule, (get) reports: "reports" => Report, (get (q: &'a str, #[serde(skip_serializing_if = "Option::is_none")] limit: Option<u64>, following: bool,)) search_accounts: "accounts/search" => Account, (get) get_endorsements: "endorsements" => Account, @@ -174,7 +174,10 @@ impl Mastodon { } /// Update the user credentials - pub async fn update_credentials(&self, changes: CredentialsBuilder) -> Result<Account> { + pub async fn update_credentials( + &self, + changes: account::CredentialsBuilder, + ) -> Result<Account> { let url = self.route("/api/v1/accounts/update_credentials"); let response = self .client diff --git a/src/registration.rs b/src/registration.rs index f46368f..1be7261 100644 --- a/src/registration.rs +++ b/src/registration.rs @@ -235,7 +235,7 @@ impl Registered { /// "the-client-id", /// "the-client-secret", /// "https://example.com/redirect", - /// auth::Scopes::read_all(), + /// Scopes::read_all(), /// false, /// ); /// let url = registration.authorize_url().unwrap(); @@ -280,7 +280,7 @@ impl Registered { /// let orig_client_id = "some-client_id"; /// let orig_client_secret = "some-client-secret"; /// let orig_redirect = "https://example.social/redirect"; - /// let orig_scopes = auth::Scopes::all(); + /// let orig_scopes = Scopes::all(); /// let orig_force_login = false; /// /// let registered = Registered::from_parts( |