diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-06 22:14:22 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-06 22:14:22 -0800 |
commit | fb6c487d42c7022f62e3f33ab34b76121a919d79 (patch) | |
tree | 5b9f36da5f05f0b9666ff585ed6e0fef86b2121b /adenosine-cli/src/lib.rs | |
parent | 0699c3b08fe1e908966b4a3fa1e2c83aecc54576 (diff) | |
download | adenosine-fb6c487d42c7022f62e3f33ab34b76121a919d79.tar.gz adenosine-fb6c487d42c7022f62e3f33ab34b76121a919d79.zip |
cli: use 'Nsid' type
Diffstat (limited to 'adenosine-cli/src/lib.rs')
-rw-r--r-- | adenosine-cli/src/lib.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/adenosine-cli/src/lib.rs b/adenosine-cli/src/lib.rs index 5d08286..aed8480 100644 --- a/adenosine-cli/src/lib.rs +++ b/adenosine-cli/src/lib.rs @@ -9,6 +9,7 @@ use std::str::FromStr; use std::time::Duration; pub mod identifiers; +use identifiers::Nsid; static APP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),); @@ -57,7 +58,7 @@ impl XrpcClient { pub fn get( &self, - nsid: &str, + nsid: &Nsid, params: Option<HashMap<String, String>>, ) -> Result<Option<Value>> { let params: HashMap<String, String> = params.unwrap_or_default(); @@ -86,7 +87,7 @@ impl XrpcClient { pub fn get_to_writer<W: std::io::Write>( &self, - nsid: &str, + nsid: &Nsid, params: Option<HashMap<String, String>>, output: &mut W, ) -> Result<u64> { @@ -115,7 +116,7 @@ impl XrpcClient { pub fn post( &self, - nsid: &str, + nsid: &Nsid, params: Option<HashMap<String, String>>, body: Option<Value>, ) -> Result<Option<Value>> { @@ -153,7 +154,7 @@ impl XrpcClient { pub fn post_cbor_from_reader<R: std::io::Read>( &self, - nsid: &str, + nsid: &Nsid, params: Option<HashMap<String, String>>, input: &mut R, ) -> Result<Option<Value>> { |