/// Apply a transformation to all [`Gcode`]s which satisfy a particular
/// condition.
///
/// # Examples
///
/// ```rust
/// use gcode::{Argument, GcodeTransforms, Span};
///
/// let f = Argument {
///     letter: 'F',
///     value: 10_000.0,
///     span: Span::placeholder(),
/// };
///
/// // append the `f` argument to all gcodes with a major number of 0 or 1.
/// let gcodes = gcode::parse("G90 G00 X5.0 Y-2.2 G01 X10.0 Z-2.0")
///     .map_gcode([0, 1], |gcode| gcode.with_argument(f));
///
/// for gcode in gcodes {
///     let major = gcode.major_number();
///     if major == 0 || major == 1 {
///         assert_eq!(gcode.value_for('F'), Some(10_000.0));
///     }
/// }
/// ```
///
/// [`Gcode`]: ../struct.Gcode.html
Apply a transformation to all [`Gcode`]s which satisfy a particular
condition.
Apply a transformation to all [ ` Gcode ` ] s which satisfy a particular condition .
fn map_gcode<S, F>(self, which_gcode: S, map: F) -> Map<Self, S, F>
    where
        S: Predicate<Gcode>,
        F: FnMut(Gcode) -> Gcode,
        Self: Sized,
    {
        Map {
            iter: self,
            selector: which_gcode,
            map,
        }
    }
fn map_gcode < S , F > ( self , which_gcode : S , map : F ) -> Map < Self , S , F > where S : Predicate < Gcode > , F : FnMut ( Gcode ) -> Gcode , Self : Sized , { Map { iter : self , selector : which_gcode , map , } }
Apply a transformation to all [`Gcode`]s which satisfy a particular
condition.
Apply a transformation to all [ ` Gcode ` ] s which satisfy a particular condition .
self
which_gcode
S
map
F
examples
```rust
use gcode::{Argument, GcodeTransforms, Span}.



append the `f` argument to all gcodes with a major number of 0 or 1.



[`Gcode`]: ../struct.Gcode.html
` ` ` rust use gcode :: { Argument GcodeTransforms Span } . append the ` f ` argument to all gcodes with a major number of 0 or 1 . [ ` Gcode ` ] : .. / struct . Gcode . html