Bump library versions
This commit is contained in:
parent
45401707c2
commit
bd71940364
3 changed files with 1380 additions and 711 deletions
2073
toot/Cargo.lock
generated
2073
toot/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,10 +1,10 @@
|
|||
[package]
|
||||
name = "toot"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Stefan Schlott <stefan@ploing.de>"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
[dependencies.elefren]
|
||||
version = "0.14"
|
||||
version = "0.22.0"
|
||||
features = ["toml"]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use std::error::Error;
|
|||
use elefren::prelude::*;
|
||||
use elefren::helpers::toml; // requires `features = ["toml"]`
|
||||
|
||||
fn main() -> Result<(), Box<Error>> {
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let mastodon = if let Ok(data) = toml::from_file("mastodon-data.toml") {
|
||||
Mastodon::from(data)
|
||||
} else {
|
||||
|
|
@ -18,8 +18,10 @@ fn main() -> Result<(), Box<Error>> {
|
|||
let status_text = args.get(1);
|
||||
match status_text {
|
||||
Some(text) => {
|
||||
let mut status = StatusBuilder::new(text);
|
||||
status.sensitive = Some(false);
|
||||
let status = StatusBuilder::new()
|
||||
.status(text)
|
||||
.sensitive(false)
|
||||
.build()?;
|
||||
mastodon.new_status(status)?;
|
||||
},
|
||||
None => println!("No text to toot"),
|
||||
|
|
@ -28,10 +30,10 @@ fn main() -> Result<(), Box<Error>> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn register() -> Result<Mastodon, Box<Error>> {
|
||||
fn register() -> Result<Mastodon, Box<dyn Error>> {
|
||||
let registration = Registration::new("https://chaos.social")
|
||||
.client_name("toot-cli")
|
||||
.scopes(Scopes::ReadWrite) // write:statuses would be sufficient. Scopes::Write didn't work
|
||||
.scopes(Scopes::read_all() | Scopes::write_all()) // write:statuses would be sufficient. Scopes::Write didn't work
|
||||
.build()?;
|
||||
let url = registration.authorize_url()?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue