Provide only explicit constructor for RenderContext

This commit is contained in:
Igor Aleksanov 2020-11-03 10:17:59 +03:00
parent 2a214e15d3
commit caf0fa20a7
2 changed files with 14 additions and 16 deletions

View file

@ -36,7 +36,7 @@ pub(crate) struct RenderContext<'a> {
}
impl<'a> RenderContext<'a> {
fn new(completion: &'a CompletionContext<'a>) -> RenderContext<'a> {
pub(crate) fn new(completion: &'a CompletionContext<'a>) -> RenderContext<'a> {
RenderContext { completion }
}
@ -74,12 +74,6 @@ impl<'a> RenderContext<'a> {
}
}
impl<'a> From<&'a CompletionContext<'a>> for RenderContext<'a> {
fn from(ctx: &'a CompletionContext<'a>) -> RenderContext<'a> {
RenderContext::new(ctx)
}
}
impl<'a> Render<'a> {
pub(crate) fn new(ctx: RenderContext<'a>) -> Render<'a> {
Render { ctx }