Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
55534100
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,发现更多精彩内容 >>
提交
55534100
编写于
12月 15, 2013
作者:
H
Huon Wilson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
std: fix spelling in docs.
上级
8f6df87c
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
51 addition
and
50 deletion
+51
-50
src/libstd/cell.rs
src/libstd/cell.rs
+2
-2
src/libstd/char.rs
src/libstd/char.rs
+2
-2
src/libstd/clone.rs
src/libstd/clone.rs
+2
-2
src/libstd/condition.rs
src/libstd/condition.rs
+1
-1
src/libstd/fmt/mod.rs
src/libstd/fmt/mod.rs
+3
-3
src/libstd/io/buffered.rs
src/libstd/io/buffered.rs
+2
-2
src/libstd/io/fs.rs
src/libstd/io/fs.rs
+7
-7
src/libstd/io/mod.rs
src/libstd/io/mod.rs
+3
-3
src/libstd/io/native/process.rs
src/libstd/io/native/process.rs
+1
-1
src/libstd/io/signal.rs
src/libstd/io/signal.rs
+1
-1
src/libstd/iter.rs
src/libstd/iter.rs
+2
-2
src/libstd/local_data.rs
src/libstd/local_data.rs
+1
-1
src/libstd/num/mod.rs
src/libstd/num/mod.rs
+2
-2
src/libstd/ops.rs
src/libstd/ops.rs
+1
-1
src/libstd/rand/distributions/mod.rs
src/libstd/rand/distributions/mod.rs
+3
-3
src/libstd/rand/mod.rs
src/libstd/rand/mod.rs
+1
-1
src/libstd/rt/sched.rs
src/libstd/rt/sched.rs
+1
-1
src/libstd/str.rs
src/libstd/str.rs
+6
-6
src/libstd/unstable/mutex.rs
src/libstd/unstable/mutex.rs
+1
-1
src/libstd/vec.rs
src/libstd/vec.rs
+9
-8
未找到文件。
src/libstd/cell.rs
浏览文件 @
55534100
...
...
@@ -81,7 +81,7 @@ pub fn borrow<'a>(&'a self) -> Ref<'a, T> {
/// Mutably borrows the wrapped value.
///
/// The borrow lasts until
e
the returned `RefMut` exits scope. The value
/// The borrow lasts until the returned `RefMut` exits scope. The value
/// cannot be borrowed while this borrow is active.
///
/// Returns `None` if the value is currently borrowed.
...
...
@@ -98,7 +98,7 @@ pub fn try_borrow_mut<'a>(&'a self) -> Option<RefMut<'a, T>> {
/// Mutably borrows the wrapped value.
///
/// The borrow lasts until
e
the returned `RefMut` exits scope. The value
/// The borrow lasts until the returned `RefMut` exits scope. The value
/// cannot be borrowed while this borrow is active.
///
/// # Failure
...
...
src/libstd/char.rs
浏览文件 @
55534100
...
...
@@ -256,7 +256,7 @@ fn decompose_hangul(s: char, f: |char|) {
}
}
/// Returns the canonical decompos
tion of a character
/// Returns the canonical decompos
ition of a character.
pub
fn
decompose_canonical
(
c
:
char
,
f
:
|
char
|)
{
if
(
c
as
uint
)
<
S_BASE
||
(
c
as
uint
)
>=
(
S_BASE
+
S_COUNT
)
{
decompose
::
canonical
(
c
,
f
);
...
...
@@ -265,7 +265,7 @@ pub fn decompose_canonical(c: char, f: |char|) {
}
}
/// Returns the compatibility decompos
tion of a character
/// Returns the compatibility decompos
ition of a character.
pub
fn
decompose_compatible
(
c
:
char
,
f
:
|
char
|)
{
if
(
c
as
uint
)
<
S_BASE
||
(
c
as
uint
)
>=
(
S_BASE
+
S_COUNT
)
{
decompose
::
compatibility
(
c
,
f
);
...
...
src/libstd/clone.rs
浏览文件 @
55534100
...
...
@@ -33,7 +33,7 @@ pub trait Clone {
/// Perform copy-assignment from `source`.
///
/// `a.clone_from(&b)` is equivalent to `a = b.clone()` in functionality,
/// but can be overriden to reuse the resources of `a` to avoid unnecessary
/// but can be overrid
d
en to reuse the resources of `a` to avoid unnecessary
/// allocations.
#[inline(always)]
fn
clone_from
(
&
mut
self
,
source
:
&
Self
)
{
...
...
@@ -141,7 +141,7 @@ pub trait DeepClone: Clone {
/// Perform deep copy-assignment from `source`.
///
/// `a.deep_clone_from(&b)` is equivalent to `a = b.deep_clone()` in
/// functionality, but can be overriden to reuse the resources of `a` to
/// functionality, but can be overrid
d
en to reuse the resources of `a` to
/// avoid unnecessary allocations.
#[inline(always)]
fn
deep_clone_from
(
&
mut
self
,
source
:
&
Self
)
{
...
...
src/libstd/condition.rs
浏览文件 @
55534100
...
...
@@ -81,7 +81,7 @@ pub struct Handler<T, U> {
/// the condition (useful for debugging).
///
/// This struct should never be created directly, but rather only through the
/// `condition!` macro provided to all libraries using
libstd
.
/// `condition!` macro provided to all libraries using
`std`
.
pub
struct
Condition
<
T
,
U
>
{
/// Name of the condition handler
name
:
&
'static
str
,
...
...
src/libstd/fmt/mod.rs
浏览文件 @
55534100
...
...
@@ -606,9 +606,9 @@ pub fn writeln(output: &mut io::Writer, args: &Arguments) {
/// See the documentation for `format` for why this function is unsafe and care
/// should be taken if calling it manually.
///
/// Thankfully the rust compiler provides
the macro `fmtf!` which will perform
///
all of this validation at compile-time and provides a safe interface for
/// invoking this function.
/// Thankfully the rust compiler provides
macros like `write!` and
///
`format_args!` which perform all of this validation at compile-time
///
and provide a safe interface for
invoking this function.
///
/// # Arguments
///
...
...
src/libstd/io/buffered.rs
浏览文件 @
55534100
...
...
@@ -202,8 +202,8 @@ fn inner_ref<'a>(&'a self) -> &'a W { &self.inner }
fn
inner_mut_ref
<
'a
>
(
&
'a
mut
self
)
->
&
'a
mut
W
{
&
mut
self
.inner
}
}
/// Wraps a Writer and buffers output to it, flushing whenever a newline (
0xa
,
///
'\n'
) is detected.
/// Wraps a Writer and buffers output to it, flushing whenever a newline (
`0x0a`
,
///
`'\n'`
) is detected.
///
/// Note that this structure does NOT flush the output when dropped.
pub
struct
LineBufferedWriter
<
W
>
{
...
...
src/libstd/io/fs.rs
浏览文件 @
55534100
...
...
@@ -249,7 +249,7 @@ pub fn unlink(path: &Path) {
/// directory, etc. This function will traverse symlinks to query
/// information about the destination file.
///
/// Returns a fully-filled out stat structure on succes, and on failure it
/// Returns a fully-filled out stat structure on succes
s
, and on failure it
/// will return a dummy stat structure (it is expected that the condition
/// raised is handled as well).
///
...
...
@@ -342,7 +342,7 @@ pub fn rename(from: &Path, to: &Path) {
///
/// # Errors
///
/// Will raise an `io_error` condition is the following situ
t
ations, but is
/// Will raise an `io_error` condition is the following situations, but is
/// not limited to just these cases:
///
/// * The `from` path is not a file
...
...
@@ -391,7 +391,7 @@ pub fn copy(from: &Path, to: &Path) {
///
/// # Errors
///
/// If this func
it
on encounters an I/O error, it will raise on the `io_error`
/// If this func
ti
on encounters an I/O error, it will raise on the `io_error`
/// condition. Some possible error situations are not having the permission to
/// change the attributes of a file or the file not existing.
pub
fn
chmod
(
path
:
&
Path
,
mode
:
io
::
FilePermission
)
{
...
...
@@ -402,7 +402,7 @@ pub fn chmod(path: &Path, mode: io::FilePermission) {
///
/// # Errors
///
/// This funtion will raise on the `io_error` condition on failure.
/// This fun
c
tion will raise on the `io_error` condition on failure.
pub
fn
chown
(
path
:
&
Path
,
uid
:
int
,
gid
:
int
)
{
io_raise
(|
io
|
io
.fs_chown
(
&
path
.to_c_str
(),
uid
,
gid
));
}
...
...
@@ -448,7 +448,7 @@ pub fn readlink(path: &Path) -> Option<Path> {
///
/// let p = Path::new("/some/dir");
/// fs::mkdir(&p, S_IRWXU as int);
/// // If we got here, our directory exists! Ho
r
ray!
/// // If we got here, our directory exists! Ho
o
ray!
///
/// # Errors
///
...
...
@@ -665,7 +665,7 @@ pub fn exists(&self) -> bool {
io
::
result
(||
self
.stat
())
.is_ok
()
}
/// Whether the underlying implemention (be it a file path, or something
/// Whether the underlying implement
at
ion (be it a file path, or something
/// else) points at a "regular file" on the FS. Will return false for paths
/// to non-existent locations or directories or other non-regular files
/// (named pipes, etc).
...
...
@@ -680,7 +680,7 @@ pub fn is_file(&self) -> bool {
}
}
/// Whether the underlying implemention (be it a file path,
/// Whether the underlying implement
at
ion (be it a file path,
/// or something else) is pointing at a directory in the underlying FS.
/// Will return false for paths to non-existent locations or if the item is
/// not a directory (eg files, named pipes, links, etc)
...
...
src/libstd/io/mod.rs
浏览文件 @
55534100
...
...
@@ -835,7 +835,7 @@ pub trait Writer {
/// Flush this output stream, ensuring that all intermediately buffered
/// contents reach their destination.
///
/// This is by default a no-op and implement
o
rs of the `Writer` trait should
/// This is by default a no-op and implement
e
rs of the `Writer` trait should
/// decide whether their stream needs to be buffered or not.
fn
flush
(
&
mut
self
)
{}
...
...
@@ -1057,7 +1057,7 @@ fn lines<'r>(&'r mut self) -> LineIterator<'r, Self> {
}
}
/// Reads a sequence of bytes leading up to a specified delim
e
ter. Once the
/// Reads a sequence of bytes leading up to a specified delim
i
ter. Once the
/// specified byte is encountered, reading ceases and the bytes up to and
/// including the delimiter are returned.
///
...
...
@@ -1156,7 +1156,7 @@ pub trait Seek {
/// A listener is a value that can consume itself to start listening for connections.
/// Doing so produces some sort of Acceptor.
pub
trait
Listener
<
T
,
A
:
Acceptor
<
T
>>
{
/// Spin up the listener and start queu
e
ing incoming connections
/// Spin up the listener and start queuing incoming connections
///
/// # Failure
///
...
...
src/libstd/io/native/process.rs
浏览文件 @
55534100
...
...
@@ -50,7 +50,7 @@ impl Process {
/// * prog - the program to run
/// * args - the arguments to pass to the program, not including the program
/// itself
/// * env - an optional env
ri
onment to specify for the child process. If
/// * env - an optional env
ir
onment to specify for the child process. If
/// this value is `None`, then the child will inherit the parent's
/// environment
/// * cwd - an optionally specified current working directory of the child,
...
...
src/libstd/io/signal.rs
浏览文件 @
55534100
...
...
@@ -34,7 +34,7 @@ pub enum Signum {
Break
=
21
i
,
/// Equivalent to SIGHUP, delivered when the user closes the terminal
/// window. On delivery of HangUp, the program is given approximately
/// 10 seconds to perfom any cleanup. After that, Windows will
/// 10 seconds to perfo
r
m any cleanup. After that, Windows will
/// unconditionally terminate it.
HangUp
=
1
i
,
/// Equivalent to SIGINT, delivered when the user presses Ctrl-c.
...
...
src/libstd/iter.rs
浏览文件 @
55534100
...
...
@@ -15,7 +15,7 @@
# The `Iterator` trait
This module defines Rust's core iteration trait. The `Iterator` trait has one
un
-
implemented method, `next`. All other methods are derived through default
unimplemented method, `next`. All other methods are derived through default
methods to perform operations such as `zip`, `chain`, `enumerate`, and `fold`.
The goal of this module is to unify iteration across all containers in Rust.
...
...
@@ -1688,7 +1688,7 @@ fn idx(&self, index: uint) -> Option<A> {
impl
<
T
>
Fuse
<
T
>
{
/// Resets the fuse such that the next call to .next() or .next_back() will
/// call the underlying iterator again even if it prevously returned None.
/// call the underlying iterator again even if it prev
i
ously returned None.
#[inline]
pub
fn
reset_fuse
(
&
mut
self
)
{
self
.done
=
false
...
...
src/libstd/local_data.rs
浏览文件 @
55534100
...
...
@@ -18,7 +18,7 @@
foreign code with bad callback interfaces.
To declare a new key for storing local data of a particular type, use the
`local_data_key!` macro. This macro will expand to a `static` item apppriately
`local_data_key!` macro. This macro will expand to a `static` item app
ro
priately
named and annotated. This name is then passed to the functions in this module to
modify/read the slot specified by the key.
...
...
src/libstd/num/mod.rs
浏览文件 @
55534100
...
...
@@ -209,7 +209,7 @@ pub trait Fractional: Num
pub
trait
Algebraic
{
/// Raise a number to a power.
fn
pow
(
&
self
,
n
:
&
Self
)
->
Self
;
/// Take the squre root of a number.
/// Take the squ
a
re root of a number.
fn
sqrt
(
&
self
)
->
Self
;
/// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
fn
rsqrt
(
&
self
)
->
Self
;
...
...
@@ -229,7 +229,7 @@ pub trait Algebraic {
/// assert_eq!(sixteen, 16.0);
/// ```
#[inline(always)]
pub
fn
pow
<
T
:
Algebraic
>
(
value
:
T
,
n
:
T
)
->
T
{
value
.pow
(
&
n
)
}
/// Take the squre root of a number.
/// Take the squ
a
re root of a number.
#[inline(always)]
pub
fn
sqrt
<
T
:
Algebraic
>
(
value
:
T
)
->
T
{
value
.sqrt
()
}
/// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
#[inline(always)]
pub
fn
rsqrt
<
T
:
Algebraic
>
(
value
:
T
)
->
T
{
value
.rsqrt
()
}
...
...
src/libstd/ops.rs
浏览文件 @
55534100
...
...
@@ -352,7 +352,7 @@ pub trait BitOr<RHS,Result> {
* # Example
*
* A trivial implementation of `BitXor`. When `Foo ^ Foo` happens, it ends up
* calling `bi
xt
or`, and therefore, `main` prints `Bitwise Xor-ing!`.
* calling `bi
tx
or`, and therefore, `main` prints `Bitwise Xor-ing!`.
*
* ```
* struct Foo;
...
...
src/libstd/rand/distributions/mod.rs
浏览文件 @
55534100
...
...
@@ -45,7 +45,7 @@ pub trait Sample<Support> {
/// `Sample`s that do not require keeping track of state.
///
/// Since no state is recored, each sample is (statistically)
/// Since no state is recor
d
ed, each sample is (statistically)
/// independent of all others, assuming the `Rng` used has this
/// property.
// XXX maybe having this separate is overkill (the only reason is to
...
...
@@ -84,7 +84,7 @@ pub struct Weighted<T> {
/// is to be chosen: higher weight is more likely.
///
/// The `Clone` restriction is a limitation of the `Sample` and
/// `IndepedentSample` traits. Note that `&T` is (cheaply) `Clone` for
/// `Indepe
n
dentSample` traits. Note that `&T` is (cheaply) `Clone` for
/// all `T`, as is `uint`, so one can store references or indices into
/// another vector.
///
...
...
@@ -92,7 +92,7 @@ pub struct Weighted<T> {
///
/// ```rust
/// use std::rand;
/// use std::rand::distributions::{Weighted, WeightedChoice, IndepedentSample};
/// use std::rand::distributions::{Weighted, WeightedChoice, Indepe
n
dentSample};
///
/// fn main() {
/// let wc = WeightedChoice::new(~[Weighted { weight: 2, item: 'a' },
...
...
src/libstd/rand/mod.rs
浏览文件 @
55534100
...
...
@@ -119,7 +119,7 @@ fn next_u64(&mut self) -> u64 {
/// Fill `dest` with random data.
///
/// This has a default implementation in terms of `next_u64` and
/// `next_u32`, but should be overriden by implementations that
/// `next_u32`, but should be overrid
d
en by implementations that
/// offer a more efficient solution than just calling those
/// methods repeatedly.
///
...
...
src/libstd/rt/sched.rs
浏览文件 @
55534100
...
...
@@ -75,7 +75,7 @@ pub struct Scheduler {
friend_handle
:
Option
<
SchedHandle
>
,
/// A fast XorShift rng for scheduler use
rng
:
XorShiftRng
,
/// A toggl
e
able idle callback
/// A togglable idle callback
idle_callback
:
Option
<~
PausibleIdleCallback
>
,
/// A countdown that starts at a random value and is decremented
/// every time a yield check is performed. When it hits 0 a task
...
...
src/libstd/str.rs
浏览文件 @
55534100
...
...
@@ -963,10 +963,9 @@ pub fn utf8_char_width(b: u8) -> uint {
return
UTF8_CHAR_WIDTH
[
b
]
as
uint
;
}
/// Struct that contains a `char` and
/// the index of the first byte of the next `char` in a string.
/// This is being used as a datastructure for iterating over
/// the utf8 bytes of a string.
/// Struct that contains a `char` and the index of the first byte of
/// the next `char` in a string. This can be used as a data structure
/// for iterating over the UTF-8 bytes of a string.
pub
struct
CharRange
{
/// Current `char`
ch
:
char
,
...
...
@@ -1570,7 +1569,8 @@ pub trait StrSlice<'a> {
/// ```
fn
is_whitespace
(
&
self
)
->
bool
;
/// Returns true if the string contains only alphanumerics.
/// Returns true if the string contains only alphanumeric code
/// points.
///
/// Alphanumeric characters are determined by `char::is_alphanumeric`.
///
...
...
@@ -2518,7 +2518,7 @@ fn as_imm_buf<T>(&self, f: |*u8, uint| -> T) -> T {
/// Methods for owned strings
pub
trait
OwnedStr
{
/// Appends a string slice to the back of a string, without overallocating
/// Appends a string slice to the back of a string, without overallocating
.
fn
push_str_no_overallocate
(
&
mut
self
,
rhs
:
&
str
);
/// Appends a string slice to the back of a string
...
...
src/libstd/unstable/mutex.rs
浏览文件 @
55534100
...
...
@@ -37,7 +37,7 @@
//! lock.unlock();
//! }
//!
//! // Use a normally initialied mutex
//! // Use a normally initiali
z
ed mutex
//! let mut lock = Mutex::new();
//! unsafe {
//! lock.lock();
...
...
src/libstd/vec.rs
浏览文件 @
55534100
...
...
@@ -402,7 +402,7 @@ pub fn unzip<T, U, V: Iterator<(T, U)>>(mut iter: V) -> (~[T], ~[U]) {
///
/// The Steinhaus–Johnson–Trotter algorithm is used.
///
/// Generates even and odd permutations alternat
ing
ly.
/// Generates even and odd permutations alternat
e
ly.
///
/// The last generated swap is always (0, 1), and it returns the
/// sequence to its initial order.
...
...
@@ -480,7 +480,7 @@ fn new_pos(i: uint, s: Direction) -> uint {
/// then each successive element is the vector with one
/// swap applied.
///
/// Generates even and odd permutations alternat
ing
ly.
/// Generates even and odd permutations alternat
e
ly.
pub
struct
Permutations
<
T
>
{
priv
swaps
:
ElementSwaps
,
priv
v
:
~
[
T
],
...
...
@@ -940,7 +940,7 @@ pub trait ImmutableVector<'a, T> {
fn
tailn
(
&
self
,
n
:
uint
)
->
&
'a
[
T
];
/// Returns all but the last element of a vector
fn
init
(
&
self
)
->
&
'a
[
T
];
/// Returns all but the last `n' elemnts of a vector
/// Returns all but the last `n' elem
e
nts of a vector
fn
initn
(
&
self
,
n
:
uint
)
->
&
'a
[
T
];
/// Returns the last element of a vector, failing if the vector is empty.
fn
last
(
&
self
)
->
&
'a
T
;
...
...
@@ -958,9 +958,10 @@ pub trait ImmutableVector<'a, T> {
/**
* Binary search a sorted vector with a comparator function.
*
* The comparator should implement an order consistent with the sort
* order of the underlying vector, returning an order code that indicates
* whether its argument is `Less`, `Equal` or `Greater` the desired target.
* The comparator function should implement an order consistent
* with the sort order of the underlying vector, returning an
* order code that indicates whether its argument is `Less`,
* `Equal` or `Greater` the desired target.
*
* Returns the index where the comparator returned `Equal`, or `None` if
* not found.
...
...
@@ -1436,14 +1437,14 @@ pub trait OwnedVector<T> {
/**
* Expands a vector in place, initializing the new elements to the result of
* a function
* a function
.
*
* Function `init_op` is called `n` times with the values [0..`n`)
*
* # Arguments
*
* * n - The number of elements to add
* * init_op - A function to call to retr
ei
ve each appended element's
* * init_op - A function to call to retr
ie
ve each appended element's
* value
*/
fn
grow_fn
(
&
mut
self
,
n
:
uint
,
op
:
|
uint
|
->
T
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录