Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
df65f59f
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
df65f59f
编写于
3月 30, 2015
作者:
E
Emeliov Dmitrii
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replace deprecated as_slice()
上级
6cf3b0b7
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
41 addition
and
42 deletion
+41
-42
src/liballoc/arc.rs
src/liballoc/arc.rs
+1
-1
src/libcollections/slice.rs
src/libcollections/slice.rs
+0
-2
src/libcollections/str.rs
src/libcollections/str.rs
+3
-3
src/libcollections/string.rs
src/libcollections/string.rs
+1
-1
src/libcollections/vec.rs
src/libcollections/vec.rs
+2
-2
src/libcollections/vec_deque.rs
src/libcollections/vec_deque.rs
+2
-1
src/libcollectionstest/fmt.rs
src/libcollectionstest/fmt.rs
+1
-1
src/libcollectionstest/slice.rs
src/libcollectionstest/slice.rs
+1
-1
src/libcollectionstest/str.rs
src/libcollectionstest/str.rs
+2
-2
src/libcore/iter.rs
src/libcore/iter.rs
+4
-4
src/libgraphviz/lib.rs
src/libgraphviz/lib.rs
+1
-1
src/librand/chacha.rs
src/librand/chacha.rs
+1
-1
src/librand/lib.rs
src/librand/lib.rs
+3
-3
src/libserialize/json.rs
src/libserialize/json.rs
+1
-1
src/libstd/fs/mod.rs
src/libstd/fs/mod.rs
+2
-2
src/libstd/io/cursor.rs
src/libstd/io/cursor.rs
+4
-4
src/libstd/old_io/fs.rs
src/libstd/old_io/fs.rs
+1
-1
src/libstd/old_io/mem.rs
src/libstd/old_io/mem.rs
+1
-1
src/libstd/old_io/net/ip.rs
src/libstd/old_io/net/ip.rs
+1
-1
src/libstd/old_io/process.rs
src/libstd/old_io/process.rs
+2
-2
src/libstd/os.rs
src/libstd/os.rs
+1
-1
src/libstd/process.rs
src/libstd/process.rs
+4
-4
src/test/run-pass-fulldeps/compiler-calls.rs
src/test/run-pass-fulldeps/compiler-calls.rs
+1
-1
src/test/run-pass/regions-refcell.rs
src/test/run-pass/regions-refcell.rs
+1
-1
未找到文件。
src/liballoc/arc.rs
浏览文件 @
df65f59f
...
...
@@ -110,7 +110,7 @@
/// let child_numbers = shared_numbers.clone();
///
/// thread::spawn(move || {
/// let local_numbers =
child_numbers.as_slice()
;
/// let local_numbers =
&child_numbers[..]
;
///
/// // Work with the local numbers
/// });
...
...
src/libcollections/slice.rs
浏览文件 @
df65f59f
...
...
@@ -556,7 +556,6 @@ pub fn as_ptr(&self) -> *const T {
/// ```rust
/// # #![feature(core)]
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
/// let s = s.as_slice();
///
/// let seek = 13;
/// assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
...
...
@@ -923,7 +922,6 @@ pub fn sort(&mut self) where T: Ord {
/// ```rust
/// # #![feature(core)]
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
/// let s = s.as_slice();
///
/// assert_eq!(s.binary_search(&13), Ok(9));
/// assert_eq!(s.binary_search(&4), Err(7));
...
...
src/libcollections/str.rs
浏览文件 @
df65f59f
...
...
@@ -1473,12 +1473,12 @@ pub fn parse<F: FromStr>(&self) -> Result<F, F::Err> {
/// let gr1 = "a\u{310}e\u{301}o\u{308}\u{332}".graphemes(true).collect::<Vec<&str>>();
/// let b: &[_] = &["a\u{310}", "e\u{301}", "o\u{308}\u{332}"];
///
/// assert_eq!(
gr1.as_slice()
, b);
/// assert_eq!(
&gr1[..]
, b);
///
/// let gr2 = "a\r\nb🇷🇺🇸🇹".graphemes(true).collect::<Vec<&str>>();
/// let b: &[_] = &["a", "\r\n", "b", "🇷🇺🇸🇹"];
///
/// assert_eq!(
gr2.as_slice()
, b);
/// assert_eq!(
&gr2[..]
, b);
/// ```
#[unstable(feature
=
"unicode"
,
reason
=
"this functionality may only be provided by libunicode"
)]
...
...
@@ -1496,7 +1496,7 @@ pub fn graphemes(&self, is_extended: bool) -> Graphemes {
/// let gr_inds = "a̐éö̲\r\n".grapheme_indices(true).collect::<Vec<(usize, &str)>>();
/// let b: &[_] = &[(0, "a̐"), (3, "é"), (6, "ö̲"), (11, "\r\n")];
///
/// assert_eq!(
gr_inds.as_slice()
, b);
/// assert_eq!(
&gr_inds[..]
, b);
/// ```
#[unstable(feature
=
"unicode"
,
reason
=
"this functionality may only be provided by libunicode"
)]
...
...
src/libcollections/string.rs
浏览文件 @
df65f59f
...
...
@@ -93,7 +93,7 @@ pub fn with_capacity(capacity: usize) -> String {
/// ```
/// # #![feature(collections, core)]
/// let s = String::from_str("hello");
/// assert_eq!(
s.as_slice()
, "hello");
/// assert_eq!(
&s[..]
, "hello");
/// ```
#[inline]
#[unstable(feature
=
"collections"
,
...
...
src/libcollections/vec.rs
浏览文件 @
df65f59f
...
...
@@ -821,13 +821,13 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
/// # #![feature(collections, core)]
/// let v = vec![0, 1, 2];
/// let w = v.map_in_place(|i| i + 3);
/// assert_eq!(
w.as_slice(), [3, 4, 5].as_slice()
);
/// assert_eq!(
&w[..], &[3, 4, 5]
);
///
/// #[derive(PartialEq, Debug)]
/// struct Newtype(u8);
/// let bytes = vec![0x11, 0x22];
/// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x));
/// assert_eq!(
newtyped_bytes.as_slice(), [Newtype(0x11), Newtype(0x22)].as_slice()
);
/// assert_eq!(
&newtyped_bytes[..], &[Newtype(0x11), Newtype(0x22)]
);
/// ```
#[unstable(feature
=
"collections"
,
reason
=
"API may change to provide stronger guarantees"
)]
...
...
src/libcollections/vec_deque.rs
浏览文件 @
df65f59f
...
...
@@ -526,7 +526,8 @@ pub fn truncate(&mut self, len: usize) {
/// buf.push_back(3);
/// buf.push_back(4);
/// let b: &[_] = &[&5, &3, &4];
/// assert_eq!(buf.iter().collect::<Vec<&i32>>().as_slice(), b);
/// let c: Vec<&i32> = buf.iter().collect();
/// assert_eq!(&c[..], b);
/// ```
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
fn
iter
(
&
self
)
->
Iter
<
T
>
{
...
...
src/libcollectionstest/fmt.rs
浏览文件 @
df65f59f
...
...
@@ -13,5 +13,5 @@
#[test]
fn
test_format
()
{
let
s
=
fmt
::
format
(
format_args!
(
"Hello, {}!"
,
"world"
));
assert_eq!
(
s
.as_slice
()
,
"Hello, world!"
);
assert_eq!
(
&
s
[
..
]
,
"Hello, world!"
);
}
src/libcollectionstest/slice.rs
浏览文件 @
df65f59f
...
...
@@ -59,7 +59,7 @@ fn test_from_elem() {
// Test on-heap from_elem.
v
=
vec!
[
20
;
6
];
{
let
v
=
v
.as_slice
()
;
let
v
=
&
v
[
..
]
;
assert_eq!
(
v
[
0
],
20
);
assert_eq!
(
v
[
1
],
20
);
assert_eq!
(
v
[
2
],
20
);
...
...
src/libcollectionstest/str.rs
浏览文件 @
df65f59f
...
...
@@ -1470,9 +1470,9 @@ fn t(s: &str, sep: &str, u: &[&str]) {
fn
test_str_default
()
{
use
std
::
default
::
Default
;
fn
t
<
S
:
Default
+
Str
>
()
{
fn
t
<
S
:
Default
+
AsRef
<
str
>
>
()
{
let
s
:
S
=
Default
::
default
();
assert_eq!
(
s
.as_
slice
(),
""
);
assert_eq!
(
s
.as_
ref
(),
""
);
}
t
::
<&
str
>
();
...
...
src/libcore/iter.rs
浏览文件 @
df65f59f
...
...
@@ -624,7 +624,7 @@ fn all<F>(&mut self, mut f: F) -> bool where
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter();
/// assert!(it.any(|x| *x == 3));
/// assert_eq!(
it.as_slice()
, [4, 5]);
/// assert_eq!(
&it[..]
, [4, 5]);
///
/// ```
#[inline]
...
...
@@ -648,7 +648,7 @@ fn any<F>(&mut self, mut f: F) -> bool where
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter();
/// assert_eq!(it.find(|&x| *x == 3).unwrap(), &3);
/// assert_eq!(
it.as_slice()
, [4, 5]);
/// assert_eq!(
&it[..]
, [4, 5]);
#[inline]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
find
<
P
>
(
&
mut
self
,
mut
predicate
:
P
)
->
Option
<
Self
::
Item
>
where
...
...
@@ -672,7 +672,7 @@ fn find<P>(&mut self, mut predicate: P) -> Option<Self::Item> where
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter();
/// assert_eq!(it.position(|x| *x == 3).unwrap(), 2);
/// assert_eq!(
it.as_slice()
, [4, 5]);
/// assert_eq!(
&it[..]
, [4, 5]);
#[inline]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
position
<
P
>
(
&
mut
self
,
mut
predicate
:
P
)
->
Option
<
usize
>
where
...
...
@@ -702,7 +702,7 @@ fn position<P>(&mut self, mut predicate: P) -> Option<usize> where
/// let a = [1, 2, 2, 4, 5];
/// let mut it = a.iter();
/// assert_eq!(it.rposition(|x| *x == 2).unwrap(), 2);
/// assert_eq!(
it.as_slice()
, [1, 2]);
/// assert_eq!(
&it[..]
, [1, 2]);
#[inline]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
rposition
<
P
>
(
&
mut
self
,
mut
predicate
:
P
)
->
Option
<
usize
>
where
...
...
src/libgraphviz/lib.rs
浏览文件 @
df65f59f
...
...
@@ -84,7 +84,7 @@
//!
//! fn edges(&'a self) -> dot::Edges<'a,Ed> {
//! let &Edges(ref edges) = self;
//!
edges.as_slice(
).into_cow()
//!
(&edges[..]
).into_cow()
//! }
//!
//! fn source(&self, e: &Ed) -> Nd { let &(s,_) = e; s }
...
...
src/librand/chacha.rs
浏览文件 @
df65f59f
...
...
@@ -198,7 +198,7 @@ fn rand<R: Rng>(other: &mut R) -> ChaChaRng {
for
word
in
&
mut
key
{
*
word
=
other
.gen
();
}
SeedableRng
::
from_seed
(
key
.as_slice
()
)
SeedableRng
::
from_seed
(
&
key
[
..
]
)
}
}
...
...
src/librand/lib.rs
浏览文件 @
df65f59f
...
...
@@ -153,7 +153,7 @@ fn next_f64(&mut self) -> f64 {
///
/// let mut v = [0; 13579];
/// thread_rng().fill_bytes(&mut v);
/// println!("{:?}", v
.as_slice()
);
/// println!("{:?}", v);
/// ```
fn
fill_bytes
(
&
mut
self
,
dest
:
&
mut
[
u8
])
{
// this could, in theory, be done by transmuting dest to a
...
...
@@ -309,9 +309,9 @@ fn choose<'a, T>(&mut self, values: &'a [T]) -> Option<&'a T> {
/// let mut rng = thread_rng();
/// let mut y = [1, 2, 3];
/// rng.shuffle(&mut y);
/// println!("{:?}", y
.as_slice()
);
/// println!("{:?}", y);
/// rng.shuffle(&mut y);
/// println!("{:?}", y
.as_slice()
);
/// println!("{:?}", y);
/// ```
fn
shuffle
<
T
>
(
&
mut
self
,
values
:
&
mut
[
T
])
{
let
mut
i
=
values
.len
();
...
...
src/libserialize/json.rs
浏览文件 @
df65f59f
...
...
@@ -100,7 +100,7 @@
//! let encoded = json::encode(&object).unwrap();
//!
//! // Deserialize using `json::decode`
//! let decoded: TestStruct = json::decode(
encoded.as_slice()
).unwrap();
//! let decoded: TestStruct = json::decode(
&encoded[..]
).unwrap();
//! }
//! ```
//!
...
...
src/libstd/fs/mod.rs
浏览文件 @
df65f59f
...
...
@@ -1327,7 +1327,7 @@ fn copy_file_ok() {
check!
(
fs
::
copy
(
&
input
,
&
out
));
let
mut
v
=
Vec
::
new
();
check!
(
check!
(
File
::
open
(
&
out
))
.read_to_end
(
&
mut
v
));
assert_eq!
(
v
.as_slice
()
,
b
"hello"
);
assert_eq!
(
&
v
[
..
]
,
b
"hello"
);
assert_eq!
(
check!
(
input
.metadata
())
.permissions
(),
check!
(
out
.metadata
())
.permissions
());
...
...
@@ -1622,7 +1622,7 @@ fn binary_file() {
check!
(
check!
(
File
::
create
(
&
tmpdir
.join
(
"test"
)))
.write
(
&
bytes
));
let
mut
v
=
Vec
::
new
();
check!
(
check!
(
File
::
open
(
&
tmpdir
.join
(
"test"
)))
.read_to_end
(
&
mut
v
));
assert
!
(
v
==
bytes
.as_slice
()
);
assert
!
(
v
==
&
bytes
[
..
]
);
}
#[test]
...
...
src/libstd/io/cursor.rs
浏览文件 @
df65f59f
...
...
@@ -282,19 +282,19 @@ fn read_to_end() {
#[test]
fn
test_slice_reader
()
{
let
in_buf
=
vec!
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
];
let
mut
reader
=
&
mut
in_buf
.as_slice
()
;
let
mut
reader
=
&
mut
&
in_buf
[
..
]
;
let
mut
buf
=
[];
assert_eq!
(
reader
.read
(
&
mut
buf
),
Ok
(
0
));
let
mut
buf
=
[
0
];
assert_eq!
(
reader
.read
(
&
mut
buf
),
Ok
(
1
));
assert_eq!
(
reader
.len
(),
7
);
let
b
:
&
[
_
]
=
&
[
0
];
assert_eq!
(
buf
.as_slice
()
,
b
);
assert_eq!
(
buf
,
b
);
let
mut
buf
=
[
0
;
4
];
assert_eq!
(
reader
.read
(
&
mut
buf
),
Ok
(
4
));
assert_eq!
(
reader
.len
(),
3
);
let
b
:
&
[
_
]
=
&
[
1
,
2
,
3
,
4
];
assert_eq!
(
buf
.as_slice
()
,
b
);
assert_eq!
(
buf
,
b
);
assert_eq!
(
reader
.read
(
&
mut
buf
),
Ok
(
3
));
let
b
:
&
[
_
]
=
&
[
5
,
6
,
7
];
assert_eq!
(
&
buf
[
..
3
],
b
);
...
...
@@ -304,7 +304,7 @@ fn test_slice_reader() {
#[test]
fn
test_buf_reader
()
{
let
in_buf
=
vec!
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
];
let
mut
reader
=
Cursor
::
new
(
in_buf
.as_slice
()
);
let
mut
reader
=
Cursor
::
new
(
&
in_buf
[
..
]
);
let
mut
buf
=
[];
assert_eq!
(
reader
.read
(
&
mut
buf
),
Ok
(
0
));
assert_eq!
(
reader
.position
(),
0
);
...
...
src/libstd/old_io/fs.rs
浏览文件 @
df65f59f
...
...
@@ -1639,7 +1639,7 @@ fn binary_file() {
check!
(
File
::
create
(
&
tmpdir
.join
(
"test"
))
.write
(
&
bytes
));
let
actual
=
check!
(
File
::
open
(
&
tmpdir
.join
(
"test"
))
.read_to_end
());
assert
!
(
actual
==
bytes
.as_slice
()
);
assert
!
(
actual
==
&
bytes
[
..
]
);
}
#[test]
...
...
src/libstd/old_io/mem.rs
浏览文件 @
df65f59f
...
...
@@ -744,7 +744,7 @@ fn bench_buf_writer(b: &mut Bencher) {
wr
.write
(
&
[
5
;
10
])
.unwrap
();
}
}
assert_eq!
(
buf
.as_
slice
(),
[
5
;
100
]
.as_slice
());
assert_eq!
(
buf
.as_
ref
(),
[
5
;
100
]
.as_ref
());
});
}
...
...
src/libstd/old_io/net/ip.rs
浏览文件 @
df65f59f
...
...
@@ -435,7 +435,7 @@ fn from_str(s: &str) -> Result<SocketAddr, ParseError> {
/// let tcp_l = TcpListener::bind("localhost:12345");
///
/// let mut udp_s = UdpSocket::bind(("127.0.0.1", 23451)).unwrap();
/// udp_s.send_to([7, 7, 7].as_
slice
(), (Ipv4Addr(127, 0, 0, 1), 23451));
/// udp_s.send_to([7, 7, 7].as_
ref
(), (Ipv4Addr(127, 0, 0, 1), 23451));
/// }
/// ```
pub
trait
ToSocketAddr
{
...
...
src/libstd/old_io/process.rs
浏览文件 @
df65f59f
...
...
@@ -376,8 +376,8 @@ pub fn spawn(&self) -> IoResult<Process> {
/// };
///
/// println!("status: {}", output.status);
/// println!("stdout: {}", String::from_utf8_lossy(output.output.as_
slice
()));
/// println!("stderr: {}", String::from_utf8_lossy(output.error.as_
slice
()));
/// println!("stdout: {}", String::from_utf8_lossy(output.output.as_
ref
()));
/// println!("stderr: {}", String::from_utf8_lossy(output.error.as_
ref
()));
/// ```
pub
fn
output
(
&
self
)
->
IoResult
<
ProcessOutput
>
{
self
.spawn
()
.and_then
(|
p
|
p
.wait_with_output
())
...
...
src/libstd/os.rs
浏览文件 @
df65f59f
...
...
@@ -311,7 +311,7 @@ pub fn split_paths<T: BytesContainer>(unparsed: T) -> Vec<Path> {
/// let key = "PATH";
/// let mut paths = os::getenv_as_bytes(key).map_or(Vec::new(), os::split_paths);
/// paths.push(Path::new("/home/xyz/bin"));
/// os::setenv(key, os::join_paths(
paths.as_slice()
).unwrap());
/// os::setenv(key, os::join_paths(
&paths[..]
).unwrap());
/// ```
#[unstable(feature
=
"os"
)]
pub
fn
join_paths
<
T
:
BytesContainer
>
(
paths
:
&
[
T
])
->
Result
<
Vec
<
u8
>
,
&
'static
str
>
{
...
...
src/libstd/process.rs
浏览文件 @
df65f59f
...
...
@@ -678,7 +678,7 @@ fn test_process_output_fail_to_start() {
fn
test_process_output_output
()
{
let
Output
{
status
,
stdout
,
stderr
}
=
Command
::
new
(
"echo"
)
.arg
(
"hello"
)
.output
()
.unwrap
();
let
output_str
=
str
::
from_utf8
(
stdout
.as_slice
()
)
.unwrap
();
let
output_str
=
str
::
from_utf8
(
&
stdout
[
..
]
)
.unwrap
();
assert
!
(
status
.success
());
assert_eq!
(
output_str
.trim
()
.to_string
(),
"hello"
);
...
...
@@ -720,7 +720,7 @@ fn test_wait_with_output_once() {
let
prog
=
Command
::
new
(
"echo"
)
.arg
(
"hello"
)
.stdout
(
Stdio
::
piped
())
.spawn
()
.unwrap
();
let
Output
{
status
,
stdout
,
stderr
}
=
prog
.wait_with_output
()
.unwrap
();
let
output_str
=
str
::
from_utf8
(
stdout
.as_slice
()
)
.unwrap
();
let
output_str
=
str
::
from_utf8
(
&
stdout
[
..
]
)
.unwrap
();
assert
!
(
status
.success
());
assert_eq!
(
output_str
.trim
()
.to_string
(),
"hello"
);
...
...
@@ -855,7 +855,7 @@ fn test_override_env() {
cmd
.env
(
"PATH"
,
&
p
);
}
let
result
=
cmd
.output
()
.unwrap
();
let
output
=
String
::
from_utf8_lossy
(
result
.stdout
.as_slice
()
)
.to_string
();
let
output
=
String
::
from_utf8_lossy
(
&
result
.stdout
[
..
]
)
.to_string
();
assert
!
(
output
.contains
(
"RUN_TEST_NEW_ENV=123"
),
"didn't find RUN_TEST_NEW_ENV inside of:
\n\n
{}"
,
output
);
...
...
@@ -864,7 +864,7 @@ fn test_override_env() {
#[test]
fn
test_add_to_env
()
{
let
result
=
env_cmd
()
.env
(
"RUN_TEST_NEW_ENV"
,
"123"
)
.output
()
.unwrap
();
let
output
=
String
::
from_utf8_lossy
(
result
.stdout
.as_slice
()
)
.to_string
();
let
output
=
String
::
from_utf8_lossy
(
&
result
.stdout
[
..
]
)
.to_string
();
assert
!
(
output
.contains
(
"RUN_TEST_NEW_ENV=123"
),
"didn't find RUN_TEST_NEW_ENV inside of:
\n\n
{}"
,
output
);
...
...
src/test/run-pass-fulldeps/compiler-calls.rs
浏览文件 @
df65f59f
...
...
@@ -77,6 +77,6 @@ fn main() {
let
mut
tc
=
TestCalls
{
count
:
1
};
// we should never get use this filename, but lets make sure they are valid args.
let
args
=
vec!
[
"compiler-calls"
.to_string
(),
"foo.rs"
.to_string
()];
rustc_driver
::
run_compiler
(
args
.as_slice
()
,
&
mut
tc
);
rustc_driver
::
run_compiler
(
&
args
[
..
]
,
&
mut
tc
);
assert
!
(
tc
.count
==
30
);
}
src/test/run-pass/regions-refcell.rs
浏览文件 @
df65f59f
...
...
@@ -29,7 +29,7 @@ fn foo<'a>(map: RefCell<HashMap<&'static str, &'a [u8]>>) {
// supposed to match the lifetime `'a`) ...
fn
foo
<
'a
>
(
map
:
RefCell
<
HashMap
<&
'static
str
,
&
'a
[
u8
]
>>
)
{
let
one
=
[
1
];
assert_eq!
(
map
.borrow
()
.get
(
"one"
),
Some
(
&
one
.as_slice
()
));
assert_eq!
(
map
.borrow
()
.get
(
"one"
),
Some
(
&
&
one
[
..
]
));
}
#[cfg(all(not(cannot_use_this_yet),not(cannot_use_this_yet_either)))]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录