Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
add explicit dyn when using trait objects
Browse files Browse the repository at this point in the history
Using bare trait objects is deprecated and now triggers a warning by
default: rust-lang/rust#61203.
  • Loading branch information
remi-dupre committed Nov 19, 2019
1 parent 55d26df commit b9a1212
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/docker_wrapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct PostgresDocker {
}

impl PostgresDocker {
pub fn new() -> Result<PostgresDocker, Box<Error>> {
pub fn new() -> Result<PostgresDocker, Box<dyn Error>> {
let mut pg_docker = PostgresDocker { ip: "".to_string() };
pg_docker.setup()?;
Ok(pg_docker)
Expand All @@ -26,7 +26,7 @@ impl PostgresDocker {
format!("{}", self.ip)
}

pub fn setup(&mut self) -> Result<(), Box<Error>> {
pub fn setup(&mut self) -> Result<(), Box<dyn Error>> {
info!("Launching the PostgresWrapper docker");
let (name, img) = ("postgres_fafnir_tests", "openmaptiles/postgis");

Expand Down Expand Up @@ -76,7 +76,7 @@ impl PostgresDocker {
}

impl ElasticsearchDocker {
pub fn new() -> Result<ElasticsearchDocker, Box<Error>> {
pub fn new() -> Result<ElasticsearchDocker, Box<dyn Error>> {
let mut el_docker = ElasticsearchDocker { ip: "".to_string() };
el_docker.setup()?;
let rubber = Rubber::new(&el_docker.host());
Expand All @@ -88,7 +88,7 @@ impl ElasticsearchDocker {
format!("http://{}:9200", self.ip)
}

pub fn setup(&mut self) -> Result<(), Box<Error>> {
pub fn setup(&mut self) -> Result<(), Box<dyn Error>> {
info!("Launching docker");
let (name, img) = ("mimirsbrunn_fafnir_tests", "elasticsearch:2");

Expand Down
8 changes: 4 additions & 4 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl<'a> ElasticSearchWrapper<'a> {
&self,
word: &str,
predicate: F,
) -> Box<Iterator<Item = mimir::Place> + 'b>
) -> Box<dyn Iterator<Item = mimir::Place> + 'b>
where
F: 'b + FnMut(&mimir::Place) -> bool,
{
Expand All @@ -169,7 +169,7 @@ impl<'a> ElasticSearchWrapper<'a> {
word: &str,
predicate: F,
search_on_global_stops: bool,
) -> Box<Iterator<Item = mimir::Place> + 'b>
) -> Box<dyn Iterator<Item = mimir::Place> + 'b>
where
F: 'b + FnMut(&mimir::Place) -> bool,
{
Expand Down Expand Up @@ -218,12 +218,12 @@ impl<'a> ElasticSearchWrapper<'a> {
})
.filter(predicate),
)
as Box<Iterator<Item = mimir::Place>>)
as Box<dyn Iterator<Item = mimir::Place>>)
}
_ => None,
}
})
.unwrap_or(Box::new(None.into_iter()) as Box<Iterator<Item = mimir::Place>>)
.unwrap_or(Box::new(None.into_iter()) as Box<dyn Iterator<Item = mimir::Place>>)
}
}

Expand Down

0 comments on commit b9a1212

Please sign in to comment.