This commit is contained in:
Oliver Scherer 2019-05-26 17:36:21 +02:00
parent fd2ecfcc89
commit 637e656451

View File

@ -488,11 +488,9 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
},
ConstValue::Slice { data, start, end } => match result.ty.sty {
ty::Ref(_, tam, _) => match tam.sty {
ty::Str => {
String::from_utf8(data.bytes[start..end].to_owned())
.ok()
.map(Constant::Str)
},
ty::Str => String::from_utf8(data.bytes[start..end].to_owned())
.ok()
.map(Constant::Str),
_ => None,
},
_ => None,