Wez Furlong
a1610f689f
Allow direct String fields to match the empty string
...
Empty is not the same as missing, and the empty string
crops up a lot in upnp/dlna.
2024-06-07 14:52:42 +02:00
Dirkjan Ochtman
dfc5894edf
Provide more context in DuplicateValue errors
2024-06-07 13:58:52 +02:00
Wez Furlong
775bad82a4
really fix scalar enum namespace handling
...
It is actually important to consider the field name when provided,
otherwise we can incorrectly match fields with different names!
2024-06-07 13:39:14 +02:00
Wez Furlong
5c0171b474
emit ::std::result::Result rather than unqualified Result
...
This fixes an issue where attempting to derive FromXml or ToXml
would fail if the embedding application had used something like
```
pub type Result<T> = std::result::Result<T, Error>;
```
2024-05-23 00:01:20 +02:00
Wez Furlong
3e72aa7ae3
fix erroneous debug assertion in nested namespace case
...
The assertion was checking to ensure that the emitted tag
had no prefix, which breaks the case where a prefix is
required, but only in debug builds!
2024-05-23 00:01:20 +02:00
Wez Furlong
05de91af02
fixup namespace handling for scalar enums
...
We need to match the default namespace from the type,
rather than the namespace from the associate id.
2024-05-23 00:01:20 +02:00
Dirkjan Ochtman
2b691c5131
Extend test to cover . and _, too
2024-04-02 07:19:39 +02:00
Dirkjan Ochtman
6b483b7e6d
Bump instant-xml-macros version to 0.4.2
2024-04-02 07:19:39 +02:00
Dirkjan Ochtman
7e3099c915
Enable namespace prefixes containing dashes
2024-04-02 07:19:39 +02:00
Dirkjan Ochtman
a0c114ed02
macros: prepare 0.4.1 release
2024-03-18 14:37:21 +01:00
dependabot[bot]
5009655734
Update heck requirement from 0.4 to 0.5
...
---
updated-dependencies:
- dependency-name: heck
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 14:26:19 +01:00
Dirkjan Ochtman
8e8dc10419
Bump MSRV to 1.61 (for memchr)
2023-10-25 22:36:20 +02:00
Dirkjan Ochtman
173997f07b
Bump version for semver-incompatible API changes
2023-10-25 22:36:20 +02:00
Dirkjan Ochtman
edad589294
Escape entities in context iterator
2023-10-25 22:36:20 +02:00
Dirkjan Ochtman
c89afc2553
Apply some clippy suggestions
2023-09-15 13:04:46 +02:00
Dirkjan Ochtman
6515ad2b4f
Bump versions to 0.3.2
2023-09-15 13:04:46 +02:00
Dirkjan Ochtman
c73a852e07
Avoid warnings for non-snake_case variable names
2023-09-15 13:04:46 +02:00
Dirkjan Ochtman
18396f4aa5
Bump version numbers for new release
2023-03-22 13:10:20 +01:00
Dirkjan Ochtman
27b39b6125
Refer to README from Cargo metadata
2023-03-22 13:10:20 +01:00
Dirkjan Ochtman
083cd567a1
Upgrade to syn 2
2023-03-21 15:28:10 +01:00
Dirkjan Ochtman
ff00c96ac9
Bump version to 0.3 for semver-incompatible change
2023-03-03 13:17:41 +01:00
Dirkjan Ochtman
a47e90038b
Bump version to 0.2
2023-02-28 17:29:59 +01:00
Dirkjan Ochtman
5058699765
Give inline accumulator type the same visibility as the target
2023-02-28 17:12:31 +01:00
Dirkjan Ochtman
f51e6ae063
Fix use of lifetimes in fields of transparent structs
2023-02-28 17:12:31 +01:00
Dirkjan Ochtman
2e7a48a212
Add basic Cargo metadata
2023-02-27 10:53:34 +01:00
Dirkjan Ochtman
8c2964b318
Improve support for raw identifier field names
2023-02-24 17:33:33 +01:00
Dirkjan Ochtman
786f035f76
Implement transparent mode for deserialization
2023-02-24 17:33:33 +01:00
Dirkjan Ochtman
c983e10a88
Provide field context to Deserializer implementations
...
Also reorders deserialize() arguments.
2023-02-24 17:33:33 +01:00
Dirkjan Ochtman
7a2e6ac735
Use associated accumulator type to deserialize into
2023-02-24 17:33:33 +01:00
Dirkjan Ochtman
be7902925e
Implement transparent mode for serialization
2023-02-24 17:33:33 +01:00
Dirkjan Ochtman
7e05d35ba6
Fix clippy lints
2023-02-21 20:35:39 +01:00
Dirkjan Ochtman
88c52e98d2
Don't error on ignored (direct) scalar nodes
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
aa45a74bb4
Improve error for unexpected nodes
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
e186684824
Skip None attributes
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
682f42aacc
Better errors for missing values
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
0bfd37a9d7
Fully qualify calls to FromXml trait methods
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
f4fb07fca6
Improve error reporting, allow 0/1 as bool values
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
4ad194fc1f
Switch from wrapped enums to forward enums
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
0a323ba302
Simplify FromXml::KIND const
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
4eafa193bd
Remove unused ToXml::KIND const
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
4768d092ca
Apply clippy suggestions
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
6b3fa93f69
Implement matches() directly on FromXml
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
a2aadde276
Attributes don't inherit the default namespace
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
f8b4364acd
Add support for direct fields
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
20f73b7e01
Add support for deserialize_with and borrow
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
5bd58698d7
Simplify logic for serializing prefixes
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
12402fb381
Serialize empty elements more efficiently
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
357fd50a9b
Ignore remaining unnamed field contents
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
0dca1bbe14
Discard ignored nodes after unnamed field element
2022-12-13 16:52:53 +01:00
Dirkjan Ochtman
ff8c0c2886
Remove unnecessary workaround
2022-12-13 16:52:53 +01:00