Skip to content

Commit aab4d6b

Browse files
committed
std: Camel case some constructors
1 parent 6c5c835 commit aab4d6b

23 files changed

+85
-86
lines changed

src/libstd/arc.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import unsafe::{SharedMutableState, shared_mutable_state,
1010
clone_shared_mutable_state, unwrap_shared_mutable_state,
1111
get_shared_mutable_state, get_shared_immutable_state};
1212
import sync;
13-
import sync::{Mutex, mutex, mutex_with_condvars,
14-
RWlock, rwlock, rwlock_with_condvars};
13+
import sync::{Mutex, mutex_with_condvars,
14+
RWlock, rwlock_with_condvars};
1515

16-
export ARC, arc, clone, get;
16+
export ARC, clone, get;
1717
export Condvar;
18-
export MutexARC, mutex_arc, mutex_arc_with_condvars, unwrap_mutex_arc;
19-
export RWARC, rw_arc, rw_arc_with_condvars, RWWriteMode, RWReadMode;
18+
export MutexARC, mutex_arc_with_condvars, unwrap_mutex_arc;
19+
export RWARC, rw_arc_with_condvars, RWWriteMode, RWReadMode;
2020
export unwrap_rw_arc;
2121

2222
/// As sync::condvar, a mechanism for unlock-and-descheduling and signalling.
@@ -73,7 +73,7 @@ impl &Condvar {
7373
struct ARC<T: const send> { x: SharedMutableState<T>; }
7474

7575
/// Create an atomically reference counted wrapper.
76-
fn arc<T: const send>(+data: T) -> ARC<T> {
76+
fn ARC<T: const send>(+data: T) -> ARC<T> {
7777
ARC { x: unsafe { shared_mutable_state(data) } }
7878
}
7979

@@ -120,7 +120,7 @@ struct MutexARCInner<T: send> { lock: Mutex; failed: bool; data: T; }
120120
struct MutexARC<T: send> { x: SharedMutableState<MutexARCInner<T>>; }
121121

122122
/// Create a mutex-protected ARC with the supplied data.
123-
fn mutex_arc<T: send>(+user_data: T) -> MutexARC<T> {
123+
fn MutexARC<T: send>(+user_data: T) -> MutexARC<T> {
124124
mutex_arc_with_condvars(user_data, 1)
125125
}
126126
/**
@@ -249,7 +249,7 @@ struct RWARC<T: const send> {
249249
}
250250
251251
/// Create a reader/writer ARC with the supplied data.
252-
fn rw_arc<T: const send>(+user_data: T) -> RWARC<T> {
252+
fn RWARC<T: const send>(+user_data: T) -> RWARC<T> {
253253
rw_arc_with_condvars(user_data, 1)
254254
}
255255
/**
@@ -445,7 +445,7 @@ mod tests {
445445
#[test]
446446
fn manually_share_arc() {
447447
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
448-
let arc_v = arc::arc(v);
448+
let arc_v = arc::ARC(v);
449449

450450
let (c, p) = pipes::stream();
451451

@@ -469,7 +469,7 @@ mod tests {
469469

470470
#[test]
471471
fn test_mutex_arc_condvar() {
472-
let arc = ~mutex_arc(false);
472+
let arc = ~MutexARC(false);
473473
let arc2 = ~arc.clone();
474474
let (c,p) = pipes::oneshot();
475475
let (c,p) = (~mut Some(c), ~mut Some(p));
@@ -491,7 +491,7 @@ mod tests {
491491
}
492492
#[test] #[should_fail] #[ignore(cfg(windows))]
493493
fn test_arc_condvar_poison() {
494-
let arc = ~mutex_arc(1);
494+
let arc = ~MutexARC(1);
495495
let arc2 = ~arc.clone();
496496
let (c,p) = pipes::stream();
497497

@@ -512,7 +512,7 @@ mod tests {
512512
}
513513
#[test] #[should_fail] #[ignore(cfg(windows))]
514514
fn test_mutex_arc_poison() {
515-
let arc = ~mutex_arc(1);
515+
let arc = ~MutexARC(1);
516516
let arc2 = ~arc.clone();
517517
do task::try {
518518
do arc2.access |one| {
@@ -525,7 +525,7 @@ mod tests {
525525
}
526526
#[test] #[should_fail] #[ignore(cfg(windows))]
527527
fn test_mutex_arc_unwrap_poison() {
528-
let arc = mutex_arc(1);
528+
let arc = MutexARC(1);
529529
let arc2 = ~(&arc).clone();
530530
let (c,p) = pipes::stream();
531531
do task::spawn {
@@ -540,7 +540,7 @@ mod tests {
540540
}
541541
#[test] #[should_fail] #[ignore(cfg(windows))]
542542
fn test_rw_arc_poison_wr() {
543-
let arc = ~rw_arc(1);
543+
let arc = ~RWARC(1);
544544
let arc2 = ~arc.clone();
545545
do task::try {
546546
do arc2.write |one| {
@@ -553,7 +553,7 @@ mod tests {
553553
}
554554
#[test] #[should_fail] #[ignore(cfg(windows))]
555555
fn test_rw_arc_poison_ww() {
556-
let arc = ~rw_arc(1);
556+
let arc = ~RWARC(1);
557557
let arc2 = ~arc.clone();
558558
do task::try {
559559
do arc2.write |one| {
@@ -566,7 +566,7 @@ mod tests {
566566
}
567567
#[test] #[should_fail] #[ignore(cfg(windows))]
568568
fn test_rw_arc_poison_dw() {
569-
let arc = ~rw_arc(1);
569+
let arc = ~RWARC(1);
570570
let arc2 = ~arc.clone();
571571
do task::try {
572572
do arc2.write_downgrade |write_mode| {
@@ -581,7 +581,7 @@ mod tests {
581581
}
582582
#[test] #[ignore(cfg(windows))]
583583
fn test_rw_arc_no_poison_rr() {
584-
let arc = ~rw_arc(1);
584+
let arc = ~RWARC(1);
585585
let arc2 = ~arc.clone();
586586
do task::try {
587587
do arc2.read |one| {
@@ -594,7 +594,7 @@ mod tests {
594594
}
595595
#[test] #[ignore(cfg(windows))]
596596
fn test_rw_arc_no_poison_rw() {
597-
let arc = ~rw_arc(1);
597+
let arc = ~RWARC(1);
598598
let arc2 = ~arc.clone();
599599
do task::try {
600600
do arc2.read |one| {
@@ -607,7 +607,7 @@ mod tests {
607607
}
608608
#[test] #[ignore(cfg(windows))]
609609
fn test_rw_arc_no_poison_dr() {
610-
let arc = ~rw_arc(1);
610+
let arc = ~RWARC(1);
611611
let arc2 = ~arc.clone();
612612
do task::try {
613613
do arc2.write_downgrade |write_mode| {
@@ -623,7 +623,7 @@ mod tests {
623623
}
624624
#[test]
625625
fn test_rw_arc() {
626-
let arc = ~rw_arc(0);
626+
let arc = ~RWARC(0);
627627
let arc2 = ~arc.clone();
628628
let (c,p) = pipes::stream();
629629

@@ -662,7 +662,7 @@ mod tests {
662662
// (4) tells writer and all other readers to contend as it downgrades.
663663
// (5) Writer attempts to set state back to 42, while downgraded task
664664
// and all reader tasks assert that it's 31337.
665-
let arc = ~rw_arc(0);
665+
let arc = ~RWARC(0);
666666

667667
// Reader tasks
668668
let mut reader_convos = ~[];

src/libstd/c_vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929

3030
export CVec;
31-
export c_vec, c_vec_with_dtor;
31+
export CVec, c_vec_with_dtor;
3232
export get, set;
3333
export len;
3434
export ptr;
@@ -66,7 +66,7 @@ struct DtorRes {
6666
* * base - A foreign pointer to a buffer
6767
* * len - The number of elements in the buffer
6868
*/
69-
unsafe fn c_vec<T>(base: *mut T, len: uint) -> CVec<T> {
69+
unsafe fn CVec<T>(base: *mut T, len: uint) -> CVec<T> {
7070
return CVecCtor({
7171
base: base,
7272
len: len,

src/libstd/ebml.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import core::Option;
77
import option::{Some, None};
88

9-
export doc;
109
export Doc;
1110
export doc_at;
1211
export maybe_get_doc;
@@ -75,7 +74,7 @@ fn vuint_at(data: &[u8], start: uint) -> {val: uint, next: uint} {
7574
} else { error!("vint too big"); fail; }
7675
}
7776

78-
fn doc(data: @~[u8]) -> Doc {
77+
fn Doc(data: @~[u8]) -> Doc {
7978
return {data: data, start: 0u, end: vec::len::<u8>(*data)};
8079
}
8180

@@ -619,7 +618,7 @@ fn test_option_int() {
619618
let mbuf = io::mem_buffer();
620619
let ebml_w = ebml::Writer(io::mem_buffer_writer(mbuf));
621620
serialize_0(ebml_w, v);
622-
let ebml_doc = ebml::doc(@io::mem_buffer_buf(mbuf));
621+
let ebml_doc = ebml::Doc(@io::mem_buffer_buf(mbuf));
623622
let deser = ebml_deserializer(ebml_doc);
624623
let v1 = deserialize_0(deser);
625624
debug!("v1 == %?", v1);

0 commit comments

Comments
 (0)