Skip to content

Commit 6abb3f6

Browse files
committed
upgrade versions
1 parent 514c17f commit 6abb3f6

File tree

8 files changed

+221
-46
lines changed

8 files changed

+221
-46
lines changed

Cargo.lock

Lines changed: 206 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ edition = "2021"
1010
anyhow = "1.0"
1111
clap = { version = "4", features = ["derive"] }
1212
cosmogony = { path = "cosmogony" }
13-
env_logger = "0.9"
13+
env_logger = "0.10.0"
1414
flate2 = "1.0"
15-
geo = "0.23"
15+
geo = "0.26.0"
1616
geojson = { version = "0.24", features = ["geo-types"] }
1717
geos = { version = "8.0", features= ["geo"] }
1818
geo-types = { version = "0.7.9", features = ["rstar"] }
1919
include_dir = "0.7"
20-
itertools = "0.10"
20+
itertools = "0.11.0"
2121
lazy_static = "1"
2222
log = "0.4"
2323
osm_boundaries_utils = "0.11.0"
2424
osmpbfreader = "0.16"
2525
rayon = "1.5"
2626
regex = "1"
27-
rstar = "0.9"
27+
rstar = "0.11.0"
2828
serde_derive = "1"
2929
serde_json = "1"
3030
serde = { version = "1", features = ["rc"] }

cosmogony/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cosmogony"
3-
version = "0.12.8"
3+
version = "0.14.0"
44
authors = ["Adrien Matissart <[email protected]>", "Antoine Desbordes <[email protected]>"]
55
license = "Apache-2.0"
66
repository = "https://github.com/osm-without-borders/cosmogony"

cosmogony/src/file_format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ impl OutputFormat {
2020
pub fn from_filename(filename: impl AsRef<Path>) -> Result<OutputFormat, Error> {
2121
ALL_EXTENSIONS
2222
.iter()
23-
.find(|&&(ref e, _)| {
23+
.find(|&(e, _)| {
2424
filename
2525
.as_ref()
2626
.file_name()
2727
.and_then(|f| f.to_str())
2828
.map_or(false, |f| f.ends_with(e))
2929
})
30-
.map(|&(_, ref f)| f.clone())
30+
.map(|(_, f)| f.clone())
3131
.ok_or_else(|| {
3232
let extensions_str = ALL_EXTENSIONS
3333
.iter()

cosmogony/src/zone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Zone {
152152
/// iter_hierarchy gives an iterator over the whole hierachy including self
153153
pub fn iter_hierarchy<'a>(&'a self, all_zones: &'a MutableSlice<'_>) -> HierarchyIterator<'a> {
154154
HierarchyIterator {
155-
zone: Some(&self),
155+
zone: Some(self),
156156
all_zones,
157157
}
158158
}
@@ -170,7 +170,7 @@ impl<'a> Iterator for HierarchyIterator<'a> {
170170
match z {
171171
Some(z) => {
172172
self.zone = match &z.parent {
173-
Some(ref p_idx) => Some(self.all_zones.get(&p_idx)),
173+
Some(ref p_idx) => Some(self.all_zones.get(p_idx)),
174174
_ => None,
175175
};
176176
Some(z)

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pub fn build_cosmogony(
229229
) -> Result<Cosmogony, Error> {
230230
let path = Path::new(&pbf_path);
231231
info!("Reading pbf with geometries...");
232-
let file = File::open(&path).context("no pbf file")?;
232+
let file = File::open(path).context("no pbf file")?;
233233
let file = BufReader::with_capacity(FILE_BUF_SIZE, file);
234234

235235
let parsed_pbf = OsmPbfReader::new(file)

src/merger.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ impl CosmogonyMerger {
3535
fn read_cosmogony(&mut self, file: &Path, writer: impl std::io::Write) -> Result<()> {
3636
let mut max_id = 0;
3737
let zones = read_zones_from_file(file)?
38-
.into_iter()
3938
.filter_map(|z| z.ok())
4039
.map(|mut z| {
4140
z.id = self.get_updated_id(z.id);

src/zone_ext.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,20 +235,20 @@ impl ZoneExt for Zone {
235235

236236
fn contains(&self, other: &Zone) -> bool {
237237
match (&self.boundary, &other.boundary) {
238-
(&Some(ref mpoly1), &Some(ref mpoly2)) => {
238+
(Some(mpoly1), Some(mpoly2)) => {
239239
let m_self: Result<Geometry, _> = mpoly1.try_into();
240240
let m_other: Result<Geometry, _> = mpoly2.try_into();
241241

242242
match (&m_self, &m_other) {
243-
(&Ok(ref m_self), &Ok(ref m_other)) => {
243+
(Ok(m_self), Ok(m_other)) => {
244244
// In GEOS, "covers" is less strict than "contains".
245245
// eg: a polygon does NOT "contain" its boundary, but "covers" it.
246246
m_self.covers(m_other)
247247
.map_err(|e| info!("impossible to compute geometries coverage for zone {:?}/{:?}: error {}",
248248
&self.osm_id, &other.osm_id, e))
249249
.unwrap_or(false)
250250
}
251-
(&Err(ref e), _) => {
251+
(Err(e), _) => {
252252
info!(
253253
"impossible to convert to geos for zone {:?}, error {}",
254254
&self.osm_id, e
@@ -259,7 +259,7 @@ impl ZoneExt for Zone {
259259
);
260260
false
261261
}
262-
(_, &Err(ref e)) => {
262+
(_, Err(e)) => {
263263
info!(
264264
"impossible to convert to geos for zone {:?}, error {}",
265265
&other.osm_id, e
@@ -278,7 +278,7 @@ impl ZoneExt for Zone {
278278

279279
fn contains_center(&self, other: &Zone) -> bool {
280280
match (&self.boundary, &other.center) {
281-
(&Some(ref mpoly1), &Some(ref point)) => mpoly1.contains(point),
281+
(Some(mpoly1), Some(point)) => mpoly1.contains(point),
282282
_ => false,
283283
}
284284
}

0 commit comments

Comments
 (0)