Skip to content
Snippets Groups Projects
Commit a4914b99 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

arti-client: Make dirmgr() and circmgr() return &Arc<..>

Previously they returned an Arc, which wasn't necessary unless the
client actually _wanted_ a new Arc.

This would be an API break, except that these functions are marked
'experimental-api', so semver does not apply; nonetheless I've noted
the break in semver_status.md, just in case we care.

Closes #369
parent b27ffe14
No related branches found
No related tags found
No related merge requests found
......@@ -783,8 +783,8 @@ impl<R: Runtime> TorClient<R> {
/// This function is unstable. It is only enabled if the crate was
/// built with the `experimental-api` feature.
#[cfg(feature = "experimental-api")]
pub fn dirmgr(&self) -> Arc<dyn tor_dirmgr::DirProvider + Send + Sync> {
Arc::clone(&self.dirmgr)
pub fn dirmgr(&self) -> &Arc<dyn tor_dirmgr::DirProvider + Send + Sync> {
&self.dirmgr
}
/// Return a reference to this this client's circuit manager.
......@@ -792,8 +792,8 @@ impl<R: Runtime> TorClient<R> {
/// This function is unstable. It is only enabled if the crate was
/// built with the `experimental-api` feature.
#[cfg(feature = "experimental-api")]
pub fn circmgr(&self) -> Arc<tor_circmgr::CircMgr<R>> {
Arc::clone(&self.circmgr)
pub fn circmgr(&self) -> &Arc<tor_circmgr::CircMgr<R>> {
&self.circmgr
}
/// Return a reference to the runtime being used by this client.
......
......@@ -17,4 +17,11 @@ Don't document other changes in this file.
We can delete older sections here after we bump the releases.
## Since Arti 0.0.3
## Since Arti 0.1.0
arti-client:
api-break (experimental only): changed circmgr() and dirmgr() to return
&Arc, not Arc.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment