Skip to content
Snippets Groups Projects
Commit 90daad99 authored by Chelsea Holland Komlo's avatar Chelsea Holland Komlo Committed by Nick Mathewson
Browse files

remove experimental rust features

allow unsafe on function that calls C
parent 7999d0bf
No related branches found
No related tags found
No related merge requests found
#![feature(inclusive_range_syntax)]
//! Copyright (c) 2016-2017, The Tor Project, Inc. */
//! See LICENSE for licensing information */
......
......@@ -362,7 +362,8 @@ fn expand_version_range(range: &str) -> Result<Vec<u32>, &'static str> {
"cannot parse protocol range upper bound",
))?;
Ok((lower..=higher).collect())
// We can use inclusive range syntax when it becomes stable.
Ok((lower..higher+1).collect())
}
/// Checks to see if there is a continuous range of integers, starting at the
......
......@@ -25,6 +25,10 @@ extern "C" fn tor_malloc_ ( size: usize) -> *mut c_void {
///
/// A `*mut c_char` that should be freed by tor_free in C
///
/// Allow unused unsafe as at compile-time, we get warnings that unsafe is not
/// needed even though this calls tor_malloc in C.
///
#[allow(unused_unsafe)]
pub fn allocate_and_copy_string(src: &String) -> *mut c_char {
let bytes: &[u8] = src.as_bytes();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment