You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: serialize.rs
    path of file: ./repos/aws-sdk-rust/sdk/aws-smithy-json/src
    
    the code of the file until where you have to start completion: /*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

use crate::escape::escape_string;
use aws_smithy_types::date_time::{DateTimeFormatError, Format};
use aws_smithy_types::primitive::Encoder;
use aws_smi
    
    pub fn number(self, value: Number) {
        match value {
            Number::PosInt(value) => {
                // itoa::Buffer is a fixed-size stack allocation, so this is cheap
                self.output.push_str(Encoder::from(value).encode());
            }
            Number::NegInt(value) => {
                self.output.push_str(Encoder::from(value).encode());
            }
            Number::Float(value) => {
                let mut encoder: Encoder = value.into();
                // Nan / infinite values actually get written in quotes as a string value
                if value.is_infinite() || value.is_nan() {
                    self.string_unchecked(encoder.encode())
                } else {
                    self.output.push_str(encoder.encode())
                }
            }
        }
    }