Skip to content

Compute the differences between two states.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

yoshuawuyts/changes

changes

crates.io version build status downloads docs.rs docs

Compute the differences between two states.

Examples

Compute a diff between two vectors

use changes::diff;

let current = vec![ 1, 2, 3 ];
let desired = vec![ 1, 2, 3, 4 ];
let diff = diff(current, desired);

println!("{:?}", diff);
// => [
//      Ops::Noop(0),            // Don't do anything at index 0
//      Ops::Noop(1),            // Don't do anything at index 0
//      Ops::Noop(2),            // Don't do anything at index 0
//      Ops::Move(3, 3),         // Move value from index 3 to current index 3
//      Ops::Done,               // End
//    ]

Installation

$ cargo add changes

Safety

This crate uses #![deny(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

Contributing

Want to join us? Check out our "Contributing" guide and take a look at some of these issues:

References

License

MIT OR Apache-2.0

About

Compute the differences between two states.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages