Skip to content

Commit d93e4ea

Browse files
committed
Change OutputMode to camel case
1 parent 13b8621 commit d93e4ea

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

vm/src/stdlib/os.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ pub fn raw_file_number(handle: File) -> i64 {
9595

9696
#[derive(Debug, Copy, Clone)]
9797
enum OutputMode {
98-
STRING,
99-
BYTES,
98+
String,
99+
Bytes,
100100
}
101101

102102
fn output_by_mode(val: String, mode: OutputMode, vm: &VirtualMachine) -> PyObjectRef {
103103
match mode {
104-
OutputMode::STRING => vm.ctx.new_str(val),
105-
OutputMode::BYTES => vm.ctx.new_bytes(val.as_bytes().to_vec()),
104+
OutputMode::String => vm.ctx.new_str(val),
105+
OutputMode::Bytes => vm.ctx.new_bytes(val.as_bytes().to_vec()),
106106
}
107107
}
108108

@@ -115,7 +115,7 @@ impl PyPathLike {
115115
fn new_str(path: String) -> Self {
116116
PyPathLike {
117117
path,
118-
mode: OutputMode::STRING,
118+
mode: OutputMode::String,
119119
}
120120
}
121121
}
@@ -127,14 +127,14 @@ impl TryFromObject for PyPathLike {
127127
l @ PyString => {
128128
Ok(PyPathLike {
129129
path: l.as_str().to_owned(),
130-
mode: OutputMode::STRING,
130+
mode: OutputMode::String,
131131
})
132132
}
133133
i @ PyBytes => {
134134
let path = objstr::clone_value(&vm.call_method(i.as_object(), "decode", vec![])?);
135135
Ok(PyPathLike {
136136
path,
137-
mode: OutputMode::BYTES,
137+
mode: OutputMode::Bytes,
138138
})
139139
}
140140
_ => {

0 commit comments

Comments
 (0)