6 Commity

Autor SHA1 Wiadomość Data
  Johannes Hofmann 7ff5efabf2 Fix compiler warnings 6 lat temu
  Johannes Hofmann 7bf89809d3 Regenerate *.rs files in `src/proto/` 6 lat temu
  Johannes Hofmann 7819fd571c CI: Disable caching of cargo directories 6 lat temu
  Johannes Hofmann bc858ab6da CI: Bump minimum supported Rust version to 1.34.2 6 lat temu
  Johannes Hofmann 592663c8d7 CI: Bump minimum supported Rust version to 1.27.2 6 lat temu
  Johannes Hofmann 30a93e56e8 CI: Bump minimum supported Rust version to 1.26.2 6 lat temu
6 zmienionych plików z 598 dodań i 509 usunięć
  1. 2
    7
      .appveyor.yml
  2. 4
    10
      .travis.yml
  3. 1
    1
      src/error.rs
  4. 1
    1
      src/mmap_blob.rs
  5. 90
    73
      src/proto/fileformat.rs
  6. 500
    417
      src/proto/osmformat.rs

+ 2
- 7
.appveyor.yml Wyświetl plik

@@ -8,20 +8,15 @@ environment:
8 8
   matrix:
9 9
     - channel: nightly
10 10
       target: x86_64-pc-windows-msvc
11
-      cargoflags: --no-default-features
12 11
     - channel: nightly
13 12
       target: x86_64-pc-windows-gnu
14
-      cargoflags: --no-default-features
15 13
     - channel: nightly
16 14
       target: i686-pc-windows-gnu
17
-      cargoflags: --no-default-features
18 15
     - channel: stable
19 16
       target: x86_64-pc-windows-msvc
20
-      cargoflags: --no-default-features
21 17
     - channel: stable
22 18
       target: i686-pc-windows-msvc
23
-      cargoflags: --no-default-features
24
-    - channel: 1.24.1
19
+    - channel: 1.34.2
25 20
       target: x86_64-pc-windows-msvc
26 21
 
27 22
 install:
@@ -41,4 +36,4 @@ build: false
41 36
 
42 37
 test_script:
43 38
   - cargo test --verbose
44
-  - cargo test --verbose %cargoflags%
39
+  - cargo test --verbose --no-default-features

+ 4
- 10
.travis.yml Wyświetl plik

@@ -1,19 +1,13 @@
1 1
 dist: trusty
2 2
 sudo: false
3 3
 language: rust
4
-cache: cargo
5 4
 rust:
6 5
   - stable
7 6
   - beta
8 7
   - nightly
9
-  - 1.24.1
8
+  - 1.34.2
10 9
 script:
11 10
   - |
12
-      if [ "$TRAVIS_RUST_VERSION" == "1.24.1" ]; then
13
-        cargo test --verbose;
14
-        cargo doc --verbose --no-deps;
15
-      else
16
-        cargo test --verbose;
17
-        cargo test --verbose --no-default-features;
18
-        cargo doc --verbose;
19
-      fi
11
+      cargo test --verbose;
12
+      cargo test --verbose --no-default-features;
13
+      cargo doc --verbose;

+ 1
- 1
src/error.rs Wyświetl plik

@@ -116,7 +116,7 @@ impl StdError for Error {
116 116
         }
117 117
     }
118 118
 
119
-    fn cause(&self) -> Option<&StdError> {
119
+    fn cause(&self) -> Option<&dyn StdError> {
120 120
         match *self.0 {
121 121
             ErrorKind::Io(ref err) => Some(err),
122 122
             ErrorKind::Protobuf{ref err, ..} => Some(err),

+ 1
- 1
src/mmap_blob.rs Wyświetl plik

@@ -190,7 +190,7 @@ impl<'a> Iterator for MmapBlobReader<'a> {
190 190
 
191 191
         match slice.len() {
192 192
             0 => return None,
193
-            1 ... 3 => {
193
+            1 ..= 3 => {
194 194
                 self.last_blob_ok = false;
195 195
                 return Some(Err(new_blob_error(BlobError::InvalidHeaderSize)));
196 196
             },

+ 90
- 73
src/proto/fileformat.rs Wyświetl plik

@@ -1,9 +1,9 @@
1
-// This file is generated by rust-protobuf 2.0.0. Do not edit
1
+// This file is generated by rust-protobuf 2.8.1. Do not edit
2 2
 // @generated
3 3
 
4 4
 // https://github.com/Manishearth/rust-clippy/issues/702
5 5
 #![allow(unknown_lints)]
6
-#![allow(clippy)]
6
+#![allow(clippy::all)]
7 7
 
8 8
 #![cfg_attr(rustfmt, rustfmt_skip)]
9 9
 
@@ -17,10 +17,15 @@
17 17
 #![allow(unsafe_code)]
18 18
 #![allow(unused_imports)]
19 19
 #![allow(unused_results)]
20
+//! Generated file from `src/proto/fileformat.proto`
20 21
 
21 22
 use protobuf::Message as Message_imported_for_functions;
22 23
 use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
23 24
 
25
+/// Generated files are compatible only with the same version
26
+/// of protobuf runtime.
27
+const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_1;
28
+
24 29
 #[derive(PartialEq,Clone,Default,Debug)]
25 30
 pub struct Blob {
26 31
     // message fields
@@ -30,8 +35,14 @@ pub struct Blob {
30 35
     lzma_data: ::protobuf::SingularField<::std::vec::Vec<u8>>,
31 36
     OBSOLETE_bzip2_data: ::protobuf::SingularField<::std::vec::Vec<u8>>,
32 37
     // special fields
33
-    unknown_fields: ::protobuf::UnknownFields,
34
-    cached_size: ::protobuf::CachedSize,
38
+    pub unknown_fields: ::protobuf::UnknownFields,
39
+    pub cached_size: ::protobuf::CachedSize,
40
+}
41
+
42
+impl<'a> ::std::default::Default for &'a Blob {
43
+    fn default() -> &'a Blob {
44
+        <Blob as ::protobuf::Message>::default_instance()
45
+    }
35 46
 }
36 47
 
37 48
 impl Blob {
@@ -41,6 +52,13 @@ impl Blob {
41 52
 
42 53
     // optional bytes raw = 1;
43 54
 
55
+
56
+    pub fn get_raw(&self) -> &[u8] {
57
+        match self.raw.as_ref() {
58
+            Some(v) => &v,
59
+            None => &[],
60
+        }
61
+    }
44 62
     pub fn clear_raw(&mut self) {
45 63
         self.raw.clear();
46 64
     }
@@ -68,15 +86,12 @@ impl Blob {
68 86
         self.raw.take().unwrap_or_else(|| ::std::vec::Vec::new())
69 87
     }
70 88
 
71
-    pub fn get_raw(&self) -> &[u8] {
72
-        match self.raw.as_ref() {
73
-            Some(v) => &v,
74
-            None => &[],
75
-        }
76
-    }
77
-
78 89
     // optional int32 raw_size = 2;
79 90
 
91
+
92
+    pub fn get_raw_size(&self) -> i32 {
93
+        self.raw_size.unwrap_or(0)
94
+    }
80 95
     pub fn clear_raw_size(&mut self) {
81 96
         self.raw_size = ::std::option::Option::None;
82 97
     }
@@ -90,12 +105,15 @@ impl Blob {
90 105
         self.raw_size = ::std::option::Option::Some(v);
91 106
     }
92 107
 
93
-    pub fn get_raw_size(&self) -> i32 {
94
-        self.raw_size.unwrap_or(0)
95
-    }
96
-
97 108
     // optional bytes zlib_data = 3;
98 109
 
110
+
111
+    pub fn get_zlib_data(&self) -> &[u8] {
112
+        match self.zlib_data.as_ref() {
113
+            Some(v) => &v,
114
+            None => &[],
115
+        }
116
+    }
99 117
     pub fn clear_zlib_data(&mut self) {
100 118
         self.zlib_data.clear();
101 119
     }
@@ -123,15 +141,15 @@ impl Blob {
123 141
         self.zlib_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
124 142
     }
125 143
 
126
-    pub fn get_zlib_data(&self) -> &[u8] {
127
-        match self.zlib_data.as_ref() {
144
+    // optional bytes lzma_data = 4;
145
+
146
+
147
+    pub fn get_lzma_data(&self) -> &[u8] {
148
+        match self.lzma_data.as_ref() {
128 149
             Some(v) => &v,
129 150
             None => &[],
130 151
         }
131 152
     }
132
-
133
-    // optional bytes lzma_data = 4;
134
-
135 153
     pub fn clear_lzma_data(&mut self) {
136 154
         self.lzma_data.clear();
137 155
     }
@@ -159,15 +177,15 @@ impl Blob {
159 177
         self.lzma_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
160 178
     }
161 179
 
162
-    pub fn get_lzma_data(&self) -> &[u8] {
163
-        match self.lzma_data.as_ref() {
180
+    // optional bytes OBSOLETE_bzip2_data = 5;
181
+
182
+
183
+    pub fn get_OBSOLETE_bzip2_data(&self) -> &[u8] {
184
+        match self.OBSOLETE_bzip2_data.as_ref() {
164 185
             Some(v) => &v,
165 186
             None => &[],
166 187
         }
167 188
     }
168
-
169
-    // optional bytes OBSOLETE_bzip2_data = 5;
170
-
171 189
     pub fn clear_OBSOLETE_bzip2_data(&mut self) {
172 190
         self.OBSOLETE_bzip2_data.clear();
173 191
     }
@@ -194,13 +212,6 @@ impl Blob {
194 212
     pub fn take_OBSOLETE_bzip2_data(&mut self) -> ::std::vec::Vec<u8> {
195 213
         self.OBSOLETE_bzip2_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
196 214
     }
197
-
198
-    pub fn get_OBSOLETE_bzip2_data(&self) -> &[u8] {
199
-        match self.OBSOLETE_bzip2_data.as_ref() {
200
-            Some(v) => &v,
201
-            None => &[],
202
-        }
203
-    }
204 215
 }
205 216
 
206 217
 impl ::protobuf::Message for Blob {
@@ -208,7 +219,7 @@ impl ::protobuf::Message for Blob {
208 219
         true
209 220
     }
210 221
 
211
-    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
222
+    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
212 223
         while !is.eof()? {
213 224
             let (field_number, wire_type) = is.read_tag_unpack()?;
214 225
             match field_number {
@@ -263,7 +274,7 @@ impl ::protobuf::Message for Blob {
263 274
         my_size
264 275
     }
265 276
 
266
-    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
277
+    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
267 278
         if let Some(ref v) = self.raw.as_ref() {
268 279
             os.write_bytes(1, &v)?;
269 280
         }
@@ -295,13 +306,13 @@ impl ::protobuf::Message for Blob {
295 306
         &mut self.unknown_fields
296 307
     }
297 308
 
298
-    fn as_any(&self) -> &::std::any::Any {
299
-        self as &::std::any::Any
309
+    fn as_any(&self) -> &dyn (::std::any::Any) {
310
+        self as &dyn (::std::any::Any)
300 311
     }
301
-    fn as_any_mut(&mut self) -> &mut ::std::any::Any {
302
-        self as &mut ::std::any::Any
312
+    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
313
+        self as &mut dyn (::std::any::Any)
303 314
     }
304
-    fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
315
+    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
305 316
         self
306 317
     }
307 318
 
@@ -326,11 +337,11 @@ impl ::protobuf::Message for Blob {
326 337
 
327 338
 impl ::protobuf::Clear for Blob {
328 339
     fn clear(&mut self) {
329
-        self.clear_raw();
330
-        self.clear_raw_size();
331
-        self.clear_zlib_data();
332
-        self.clear_lzma_data();
333
-        self.clear_OBSOLETE_bzip2_data();
340
+        self.raw.clear();
341
+        self.raw_size = ::std::option::Option::None;
342
+        self.zlib_data.clear();
343
+        self.lzma_data.clear();
344
+        self.OBSOLETE_bzip2_data.clear();
334 345
         self.unknown_fields.clear();
335 346
     }
336 347
 }
@@ -348,8 +359,14 @@ pub struct BlobHeader {
348 359
     indexdata: ::protobuf::SingularField<::std::vec::Vec<u8>>,
349 360
     datasize: ::std::option::Option<i32>,
350 361
     // special fields
351
-    unknown_fields: ::protobuf::UnknownFields,
352
-    cached_size: ::protobuf::CachedSize,
362
+    pub unknown_fields: ::protobuf::UnknownFields,
363
+    pub cached_size: ::protobuf::CachedSize,
364
+}
365
+
366
+impl<'a> ::std::default::Default for &'a BlobHeader {
367
+    fn default() -> &'a BlobHeader {
368
+        <BlobHeader as ::protobuf::Message>::default_instance()
369
+    }
353 370
 }
354 371
 
355 372
 impl BlobHeader {
@@ -359,6 +376,13 @@ impl BlobHeader {
359 376
 
360 377
     // required string type = 1;
361 378
 
379
+
380
+    pub fn get_field_type(&self) -> &str {
381
+        match self.field_type.as_ref() {
382
+            Some(v) => &v,
383
+            None => "",
384
+        }
385
+    }
362 386
     pub fn clear_field_type(&mut self) {
363 387
         self.field_type.clear();
364 388
     }
@@ -386,15 +410,15 @@ impl BlobHeader {
386 410
         self.field_type.take().unwrap_or_else(|| ::std::string::String::new())
387 411
     }
388 412
 
389
-    pub fn get_field_type(&self) -> &str {
390
-        match self.field_type.as_ref() {
413
+    // optional bytes indexdata = 2;
414
+
415
+
416
+    pub fn get_indexdata(&self) -> &[u8] {
417
+        match self.indexdata.as_ref() {
391 418
             Some(v) => &v,
392
-            None => "",
419
+            None => &[],
393 420
         }
394 421
     }
395
-
396
-    // optional bytes indexdata = 2;
397
-
398 422
     pub fn clear_indexdata(&mut self) {
399 423
         self.indexdata.clear();
400 424
     }
@@ -422,15 +446,12 @@ impl BlobHeader {
422 446
         self.indexdata.take().unwrap_or_else(|| ::std::vec::Vec::new())
423 447
     }
424 448
 
425
-    pub fn get_indexdata(&self) -> &[u8] {
426
-        match self.indexdata.as_ref() {
427
-            Some(v) => &v,
428
-            None => &[],
429
-        }
430
-    }
431
-
432 449
     // required int32 datasize = 3;
433 450
 
451
+
452
+    pub fn get_datasize(&self) -> i32 {
453
+        self.datasize.unwrap_or(0)
454
+    }
434 455
     pub fn clear_datasize(&mut self) {
435 456
         self.datasize = ::std::option::Option::None;
436 457
     }
@@ -443,10 +464,6 @@ impl BlobHeader {
443 464
     pub fn set_datasize(&mut self, v: i32) {
444 465
         self.datasize = ::std::option::Option::Some(v);
445 466
     }
446
-
447
-    pub fn get_datasize(&self) -> i32 {
448
-        self.datasize.unwrap_or(0)
449
-    }
450 467
 }
451 468
 
452 469
 impl ::protobuf::Message for BlobHeader {
@@ -460,7 +477,7 @@ impl ::protobuf::Message for BlobHeader {
460 477
         true
461 478
     }
462 479
 
463
-    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
480
+    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
464 481
         while !is.eof()? {
465 482
             let (field_number, wire_type) = is.read_tag_unpack()?;
466 483
             match field_number {
@@ -503,7 +520,7 @@ impl ::protobuf::Message for BlobHeader {
503 520
         my_size
504 521
     }
505 522
 
506
-    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
523
+    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
507 524
         if let Some(ref v) = self.field_type.as_ref() {
508 525
             os.write_string(1, &v)?;
509 526
         }
@@ -529,13 +546,13 @@ impl ::protobuf::Message for BlobHeader {
529 546
         &mut self.unknown_fields
530 547
     }
531 548
 
532
-    fn as_any(&self) -> &::std::any::Any {
533
-        self as &::std::any::Any
549
+    fn as_any(&self) -> &dyn (::std::any::Any) {
550
+        self as &dyn (::std::any::Any)
534 551
     }
535
-    fn as_any_mut(&mut self) -> &mut ::std::any::Any {
536
-        self as &mut ::std::any::Any
552
+    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
553
+        self as &mut dyn (::std::any::Any)
537 554
     }
538
-    fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
555
+    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
539 556
         self
540 557
     }
541 558
 
@@ -560,9 +577,9 @@ impl ::protobuf::Message for BlobHeader {
560 577
 
561 578
 impl ::protobuf::Clear for BlobHeader {
562 579
     fn clear(&mut self) {
563
-        self.clear_field_type();
564
-        self.clear_indexdata();
565
-        self.clear_datasize();
580
+        self.field_type.clear();
581
+        self.indexdata.clear();
582
+        self.datasize = ::std::option::Option::None;
566 583
         self.unknown_fields.clear();
567 584
     }
568 585
 }

+ 500
- 417
src/proto/osmformat.rs
Plik diff jest za duży
Wyświetl plik