fn verify_piece(&mut self, p: &parse::Piece) {
        match *p {
            parse::String(..) => {}
            parse::NextArgument(ref arg) => {
                // width/precision first, if they have implicit positional
                // parameters it makes more sense to consume them first.
                self.verify_count(arg.format.width);
                self.verify_count(arg.format.precision);

                // argument second, if it's an implicit positional parameter
                // it's written second, so it should come after width/precision.
                let pos = match arg.position {
                    parse::ArgumentIs(i) | parse::ArgumentImplicitlyIs(i) => Exact(i),
                    parse::ArgumentNamed(s) => Named(s.to_string()),
                };

                let ty = Placeholder(arg.format.ty.to_string());
                self.verify_arg_type(pos, ty);
                self.curpiece += 1;
            }
        }
    }
/// Verifies one piece of a parse string, and remembers it if valid.
/// All errors are not emitted as fatal so we can continue giving errors
/// about this and possibly other format strings.
Verifies one piece of a parse string, and remembers it if valid.
All errors are not emitted as fatal so we can continue giving errors
about this and possibly other format strings.
Verifies one piece of a parse string and remembers it if valid . All errors are not emitted as fatal so we can continue giving errors about this and possibly other format strings .
fn verify_piece(&mut self, p: &parse::Piece) {
        match *p {
            parse::String(..) => {}
            parse::NextArgument(ref arg) => {
                // width/precision first, if they have implicit positional
                // parameters it makes more sense to consume them first.
                self.verify_count(arg.format.width);
                self.verify_count(arg.format.precision);
                // argument second, if it's an implicit positional parameter
                // it's written second, so it should come after width/precision.
                let pos = match arg.position {
                    parse::ArgumentIs(i) | parse::ArgumentImplicitlyIs(i) => Exact(i),
                    parse::ArgumentNamed(s) => Named(s.to_string()),
                };
                let ty = Placeholder(arg.format.ty.to_string());
                self.verify_arg_type(pos, ty);
                self.curpiece += 1;
            }
        }
    }
fn verify_piece ( & mut self , p : & parse :: Piece ) { match * p { parse :: String ( .. ) => { } parse :: NextArgument ( ref arg ) => { // width/precision first, if they have implicit positional // parameters it makes more sense to consume them first. self . verify_count ( arg . format . width ) ; self . verify_count ( arg . format . precision ) ; // argument second, if it's an implicit positional parameter // it's written second, so it should come after width/precision. let pos = match arg . position { parse :: ArgumentIs ( i ) | parse :: ArgumentImplicitlyIs ( i ) => Exact ( i ) , parse :: ArgumentNamed ( s ) => Named ( s . to_string ( ) ) , } ; let ty = Placeholder ( arg . format . ty . to_string ( ) ) ; self . verify_arg_type ( pos , ty ) ; self . curpiece += 1 ; } } }
Verifies one piece of a parse string, and remembers it if valid.
Verifies one piece of a parse string and remembers it if valid .
&mut self
p
&parse::Piece
&mut self
p
&parse::Piece