summaryrefslogtreecommitdiff
path: root/src/rust/protover/protover.rs
diff options
context:
space:
mode:
authorIsis Lovecruft <isis@torproject.org>2018-02-10 01:21:31 +0000
committerIsis Lovecruft <isis@torproject.org>2018-02-10 01:21:31 +0000
commit45c59eff6c0b261d1f868eb22e0bd36a39dfdbb3 (patch)
tree23fb9c5b36d3cdd35844f5e93d9e268ff3c10a77 /src/rust/protover/protover.rs
parentd9826b0a30f42754dc5764ce02c7b0271d996c92 (diff)
downloadtor-45c59eff6c0b261d1f868eb22e0bd36a39dfdbb3.tar.gz
tor-45c59eff6c0b261d1f868eb22e0bd36a39dfdbb3.zip
rust: Replace two `unwrap()`s in FFI code with `unwrap_or()`s.
Diffstat (limited to 'src/rust/protover/protover.rs')
-rw-r--r--src/rust/protover/protover.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rust/protover/protover.rs b/src/rust/protover/protover.rs
index 826f1b73f1..25f776aed4 100644
--- a/src/rust/protover/protover.rs
+++ b/src/rust/protover/protover.rs
@@ -110,7 +110,7 @@ pub fn get_supported_protocols() -> &'static str {
// The `unwrap` is safe becauase we SUPPORTED_PROTOCOLS is under
// our control.
str::from_utf8(&SUPPORTED_PROTOCOLS[..SUPPORTED_PROTOCOLS.len() - 1])
- .unwrap()
+ .unwrap_or("")
}
pub struct SupportedProtocols(HashMap<Proto, Versions>);