SUPERAndroidAnalyzer / abxml-rs

Android binary XML decoding library in Rust.
Apache License 2.0
27 stars 5 forks source link

Consider implementing `ToOwned` #17

Closed Razican closed 7 years ago

Razican commented 7 years ago

Some Clippy warnings show that the correct way of implementing to_owned methods is using std::borrow::ToOwned. I think it's a good idea to implement it that way.

gnieto commented 7 years ago

Closing with: https://github.com/gnieto/abxml-rs/pull/43

Implementing ToOwned on buffers means that Borrow needs to be implemented on wrappers. Implementing Borrow is supposed to be non-allocating, which is not possible with the current architecture.

The intention is to implement TryFrom (https://doc.rust-lang.org/core/convert/trait.TryFrom.html) on buffers when it will be stable.