aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-cli/src/bin/adenosine.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-06 20:52:54 -0800
committerBryan Newbold <bnewbold@robocracy.org>2022-11-06 20:52:54 -0800
commit3320e8fa5d120b8bc4917152114cf78cb0e504dc (patch)
tree0249e18d462740b174a6ce5c5a0322f63a6d5c8f /adenosine-cli/src/bin/adenosine.rs
parent2641389cb74939df9090a8183ec67ab0558f0b06 (diff)
downloadadenosine-3320e8fa5d120b8bc4917152114cf78cb0e504dc.tar.gz
adenosine-3320e8fa5d120b8bc4917152114cf78cb0e504dc.zip
cli: partial clippy cleanups
Diffstat (limited to 'adenosine-cli/src/bin/adenosine.rs')
-rw-r--r--adenosine-cli/src/bin/adenosine.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/adenosine-cli/src/bin/adenosine.rs b/adenosine-cli/src/bin/adenosine.rs
index 0062763..8b937bc 100644
--- a/adenosine-cli/src/bin/adenosine.rs
+++ b/adenosine-cli/src/bin/adenosine.rs
@@ -294,7 +294,7 @@ fn run(opt: Opt) -> Result<()> {
.map(|v| v.to_string())
.or(jwt_did)
.ok_or(anyhow!("expected a name, or self via auth token"))?;
- params.insert("user".to_string(), name.to_string());
+ params.insert("user".to_string(), name);
xrpc_client.get("com.atproto.repoDescribe", Some(params))?
}
Command::Resolve { name } => {
@@ -320,7 +320,7 @@ fn run(opt: Opt) -> Result<()> {
Command::Ls { uri } => {
// TODO: option to print fully-qualified path?
params.insert("user".to_string(), uri.repository.to_string());
- if !uri.collection.is_some() {
+ if uri.collection.is_none() {
// if a repository, but no collection, list the collections
let describe = xrpc_client
.get("com.atproto.repoDescribe", Some(params))?
@@ -331,17 +331,14 @@ fn run(opt: Opt) -> Result<()> {
{
println!(
"at://{}/{}",
- uri.repository.to_string(),
+ uri.repository,
c.as_str()
.ok_or(anyhow!("expected collection as a JSON string"))?
);
}
- } else if uri.collection.is_some() && !uri.record.is_some() {
+ } else if uri.collection.is_some() && uri.record.is_none() {
// if a collection, but no record, list the records (with extracted timestamps)
- params.insert(
- "collection".to_string(),
- uri.collection.unwrap().to_string(),
- );
+ params.insert("collection".to_string(), uri.collection.unwrap());
let records = xrpc_client
.get("com.atproto.repoListRecords", Some(params))?
.ok_or(anyhow!("expected a repoListRecords response"))?;
@@ -573,7 +570,7 @@ fn run(opt: Opt) -> Result<()> {
.map(|v| v.to_string())
.or(jwt_did)
.ok_or(anyhow!("expected a name, or self via auth token"))?;
- params.insert("user".to_string(), name.to_string());
+ params.insert("user".to_string(), name);
xrpc_client.get("app.bsky.getProfile", Some(params))?
}
Command::Bsky {