From d93e4eaf4e45e4d39a379487e67265d7341ae175 Mon Sep 17 00:00:00 2001 From: Aviv Palivoda Date: Sat, 21 Mar 2020 10:11:44 +0200 Subject: [PATCH] Change OutputMode to camel case --- vm/src/stdlib/os.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vm/src/stdlib/os.rs b/vm/src/stdlib/os.rs index d20cf6d2a7..e170e5503e 100644 --- a/vm/src/stdlib/os.rs +++ b/vm/src/stdlib/os.rs @@ -95,14 +95,14 @@ pub fn raw_file_number(handle: File) -> i64 { #[derive(Debug, Copy, Clone)] enum OutputMode { - STRING, - BYTES, + String, + Bytes, } fn output_by_mode(val: String, mode: OutputMode, vm: &VirtualMachine) -> PyObjectRef { match mode { - OutputMode::STRING => vm.ctx.new_str(val), - OutputMode::BYTES => vm.ctx.new_bytes(val.as_bytes().to_vec()), + OutputMode::String => vm.ctx.new_str(val), + OutputMode::Bytes => vm.ctx.new_bytes(val.as_bytes().to_vec()), } } @@ -115,7 +115,7 @@ impl PyPathLike { fn new_str(path: String) -> Self { PyPathLike { path, - mode: OutputMode::STRING, + mode: OutputMode::String, } } } @@ -127,14 +127,14 @@ impl TryFromObject for PyPathLike { l @ PyString => { Ok(PyPathLike { path: l.as_str().to_owned(), - mode: OutputMode::STRING, + mode: OutputMode::String, }) } i @ PyBytes => { let path = objstr::clone_value(&vm.call_method(i.as_object(), "decode", vec![])?); Ok(PyPathLike { path, - mode: OutputMode::BYTES, + mode: OutputMode::Bytes, }) } _ => {