# Rust hash update value

* entry
* new
* or_insert

* Using the `or_insert` method we can update a value and insert a default value in case the key did not exist.

{% embed include file="src/examples/hashes/update-hash-value/src/main.rs" %}
{% embed include file="src/examples/hashes/update-hash-value/out.out" %}

{% embed include file="src/examples/hashes/updating-values/src/main.rs" %}


