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: error.rs
    path of file: ./repos/qr-rs/src
    
    the code of the file until where you have to start completion: // qr-rs: Encode URLs or text into QR codes.
// Copyright (C) 2022 Marco Radocchia
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General
    
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        match self {
            Self::Warning(warning) => match warning {
                Warning::UnexpectedScaleOpt => write!(
                    f,
                    "ignoring `scale` CLI option with non-raster output format"
                ),
            },
            Self::Error(error) => match error {
                Error::QrCodeErr(msg) => write!(f, "unable to generate QR code: {msg}"),
                Error::InvalidOutputExt => write!(f, "invalid output file extension"),
                Error::SvgOutputErr(msg) => write!(f, "unable to write SVG output file: {msg}"),
                Error::RasterOutputErr(msg) => {
                    write!(f, "unable to write raster image file: {msg}")
                }
            },
        }
    }