mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
repo: move base_repo() off of Repo
trait
We only ever call `base_repo()` on `MutableRepo` instances.
This commit is contained in:
parent
ea498df539
commit
d089c22232
1 changed files with 4 additions and 10 deletions
|
@ -46,8 +46,6 @@ use crate::view::{RefName, View};
|
|||
use crate::{backend, op_store};
|
||||
|
||||
pub trait Repo {
|
||||
fn base_repo(&self) -> &Arc<ReadonlyRepo>;
|
||||
|
||||
fn store(&self) -> &Arc<Store>;
|
||||
|
||||
fn op_store(&self) -> &Arc<dyn OpStore>;
|
||||
|
@ -262,10 +260,6 @@ impl ReadonlyRepo {
|
|||
}
|
||||
|
||||
impl Repo for Arc<ReadonlyRepo> {
|
||||
fn base_repo(&self) -> &Arc<ReadonlyRepo> {
|
||||
self
|
||||
}
|
||||
|
||||
fn store(&self) -> &Arc<Store> {
|
||||
&self.store
|
||||
}
|
||||
|
@ -648,6 +642,10 @@ impl MutableRepo {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn base_repo(&self) -> &Arc<ReadonlyRepo> {
|
||||
&self.base_repo
|
||||
}
|
||||
|
||||
fn view_mut(&mut self) -> &mut View {
|
||||
self.view.get_mut()
|
||||
}
|
||||
|
@ -1134,10 +1132,6 @@ impl MutableRepo {
|
|||
}
|
||||
|
||||
impl Repo for MutableRepo {
|
||||
fn base_repo(&self) -> &Arc<ReadonlyRepo> {
|
||||
&self.base_repo
|
||||
}
|
||||
|
||||
fn store(&self) -> &Arc<Store> {
|
||||
self.base_repo.store()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue