xso-proc: add fancy hack to allow codec = Foo<Bar>
We can do this because we know that `x < y` cannot create a `TextCodec<T>` for any `T`. This is because `<` is guaranteed to return a boolean value, and we simply don't implement `TextCodec<T>` on bool.
This commit is contained in:
parent
271c31c9d4
commit
2fe3c0cef2
4 changed files with 120 additions and 12 deletions
|
|
@ -20,7 +20,7 @@ pub struct Handshake {
|
|||
///
|
||||
/// If None, it is the successful reply from the server, the stream is now
|
||||
/// fully established and both sides can now exchange stanzas.
|
||||
#[xml(text(codec = FixedHex::<20>))]
|
||||
#[xml(text(codec = FixedHex<20>))]
|
||||
pub data: Option<[u8; 20]>,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ pub struct VCardUpdate {
|
|||
#[xml(namespace = ns::VCARD_UPDATE, name = "photo")]
|
||||
pub struct Photo {
|
||||
/// The SHA1 hash of the avatar. Empty when there is no photo.
|
||||
#[xml(text(codec = FixedHex::<20>))]
|
||||
#[xml(text(codec = FixedHex<20>))]
|
||||
pub data: Option<[u8; 20]>,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue