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

Commit 8f4695f

Browse files
committed
add explicit dyn when using trait objects
Using bare trait objects is deprecated and now triggers a warning by default: rust-lang/rust#61203.
1 parent f9aaaff commit 8f4695f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/docker_wrapper/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct PostgresDocker {
1616
}
1717

1818
impl PostgresDocker {
19-
pub fn new() -> Result<PostgresDocker, Box<Error>> {
19+
pub fn new() -> Result<PostgresDocker, Box<dyn Error>> {
2020
let mut pg_docker = PostgresDocker { ip: "".to_string() };
2121
pg_docker.setup()?;
2222
Ok(pg_docker)
@@ -26,7 +26,7 @@ impl PostgresDocker {
2626
format!("{}", self.ip)
2727
}
2828

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

@@ -76,7 +76,7 @@ impl PostgresDocker {
7676
}
7777

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

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

tests/tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl<'a> ElasticSearchWrapper<'a> {
157157
&self,
158158
word: &str,
159159
predicate: F,
160-
) -> Box<Iterator<Item = mimir::Place> + 'b>
160+
) -> Box<dyn Iterator<Item = mimir::Place> + 'b>
161161
where
162162
F: 'b + FnMut(&mimir::Place) -> bool,
163163
{
@@ -169,7 +169,7 @@ impl<'a> ElasticSearchWrapper<'a> {
169169
word: &str,
170170
predicate: F,
171171
search_on_global_stops: bool,
172-
) -> Box<Iterator<Item = mimir::Place> + 'b>
172+
) -> Box<dyn Iterator<Item = mimir::Place> + 'b>
173173
where
174174
F: 'b + FnMut(&mimir::Place) -> bool,
175175
{
@@ -218,12 +218,12 @@ impl<'a> ElasticSearchWrapper<'a> {
218218
})
219219
.filter(predicate),
220220
)
221-
as Box<Iterator<Item = mimir::Place>>)
221+
as Box<dyn Iterator<Item = mimir::Place>>)
222222
}
223223
_ => None,
224224
}
225225
})
226-
.unwrap_or(Box::new(None.into_iter()) as Box<Iterator<Item = mimir::Place>>)
226+
.unwrap_or(Box::new(None.into_iter()) as Box<dyn Iterator<Item = mimir::Place>>)
227227
}
228228
}
229229

0 commit comments

Comments
 (0)