#1 bump rust-ini to 0.15
Merged 3 years ago by decathorpe. Opened 3 years ago by decathorpe.
Unknown source master  into  master

@@ -0,0 +1,49 @@

+ diff --git a/src/file/format/ini.rs b/src/file/format/ini.rs

+ index e5e5950..b463560 100644

+ --- a/src/file/format/ini.rs

+ +++ b/src/file/format/ini.rs

+ @@ -11,25 +11,25 @@ pub fn parse(

+      let mut map: HashMap<String, Value> = HashMap::new();

+      let i = Ini::load_from_str(text)?;

+      for (sec, prop) in i.iter() {

+ -        match *sec {

+ -            Some(ref sec) => {

+ +        match sec {

+ +            Some(sec) => {

+                  let mut sec_map: HashMap<String, Value> = HashMap::new();

+                  for (k, v) in prop.iter() {

+                      sec_map.insert(

+ -                        k.clone(),

+ -                        Value::new(uri, ValueKind::String(v.clone())),

+ +                        k.to_owned(),

+ +                        Value::new(uri, ValueKind::String(v.to_owned())),

+                      );

+                  }

+                  map.insert(

+ -                    sec.clone(),

+ +                    sec.to_owned(),

+                      Value::new(uri, ValueKind::Table(sec_map)),

+                  );

+              }

+              None => {

+                  for (k, v) in prop.iter() {

+                      map.insert(

+ -                        k.clone(),

+ -                        Value::new(uri, ValueKind::String(v.clone())),

+ +                        k.to_owned(),

+ +                        Value::new(uri, ValueKind::String(v.to_owned())),

+                      );

+                  }

+              }

+ diff --git a/tests/file_ini.rs b/tests/file_ini.rs

+ index 0b7b6a0..844beea 100644

+ --- a/tests/file_ini.rs

+ +++ b/tests/file_ini.rs

+ @@ -63,6 +63,6 @@ fn test_error_parse() {

+      assert!(res.is_err());

+      assert_eq!(

+          res.unwrap_err().to_string(),

+ -        r#"2:0 Expecting "[Some('='), Some(':')]" but found EOF. in tests/Settings-invalid.ini"#

+ +        r#"2:0 expecting "[Some('='), Some(':')]" but found EOF. in tests/Settings-invalid.ini"#

+      );

+  }

file modified
+10 -1
@@ -1,5 +1,14 @@

  --- config-0.10.1/Cargo.toml	2019-12-08T02:22:44+00:00

- +++ config-0.10.1/Cargo.toml	2020-02-23T09:54:25.890349+00:00

+ +++ config-0.10.1/Cargo.toml	2020-09-28T23:24:14.343311+00:00

+ @@ -28,7 +28,7 @@

+  version = "5.0.0"

+  

+  [dependencies.rust-ini]

+ -version = "0.13"

+ +version = "0.15"

+  optional = true

+  

+  [dependencies.serde]

  @@ -54,13 +54,13 @@

   features = ["serde"]

   

file modified
+7 -1
@@ -6,7 +6,7 @@

  

  Name:           rust-%{crate}

  Version:        0.10.1

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        Layered configuration system for Rust applications

  

  # Upstream license specification: MIT/Apache-2.0
@@ -16,7 +16,10 @@

  # Initial patched metadata

  # * serde-hjson is not packaged, so remove from default features

  # * Update float-cmp to 0.6, https://github.com/mehcode/config-rs/pull/131

+ # * Update rust-ini to 0.15, https://github.com/mehcode/config-rs/pull/152

  Patch0:         config-fix-metadata.diff

+ # adapt to small API changes between rust-ini 0.13 and 0.15

+ Patch1:         00-port-to-ini-0.15.patch

  

  ExclusiveArch:  %{rust_arches}

  %if %{__cargo_skip_build}
@@ -183,6 +186,9 @@

  %endif

  

  %changelog

+ * Mon Sep 28 2020 Fabio Valentini <decathorpe@gmail.com> - 0.10.1-3

+ - Bump rust-ini to 0.15.

+ 

  * Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

  

Pull-Request has been merged by decathorpe

3 years ago