version.rs 331 字节
Newer Older
R
Ryan Dahl 已提交
1
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
A
Andy Hayden 已提交
2 3
use crate::libdeno;

R
Ryan Dahl 已提交
4 5
use std::ffi::CStr;

6
pub const DENO: &str = env!("CARGO_PKG_VERSION");
R
Ryan Dahl 已提交
7

8 9 10
pub fn v8() -> &'static str {
  let version = unsafe { libdeno::deno_v8_version() };
  let c_str = unsafe { CStr::from_ptr(version) };
A
Andy Hayden 已提交
11
  c_str.to_str().unwrap()
R
Ryan Dahl 已提交
12
}