fn map_argument<S, A, F>(
        self,
        which_gcode: S,
        which_arg: A,
        map: F,
    ) -> MapArg<Self, S, A, F>
    where
        Self: Sized,
        S: Predicate<Gcode>,
        A: Predicate<Argument>,
        F: FnMut(f32) -> f32,
    {
        MapArg {
            iter: self,
            gcode_selector: which_gcode,
            arg_selector: which_arg,
            map,
        }
    }
/// Change the value of a particular gcode's argument.
///
/// # Examples
///
/// To apply a translation in the `X` direction to a selection of move
/// commands (e.g. `G00`, `G01`, `G02`, and `G03`) you can do the following:
///
/// ```rust
/// use gcode::GcodeTransforms;
///
/// let src = "G90 G00 X5.0 Y-2.2 G01 X10.0 Z-2.0 G04 X30.0";
/// let delta = 50.0;
///
/// let translated = gcode::parse(src)
///     .map_argument([0, 1, 2, 3], 'X', |x| x + delta);
///
/// let x_values_should_be = vec![5.0 + delta, 10.0 + delta];
///
/// let got: Vec<f32> = translated
///     .filter(|gcode| [0, 1, 2, 3].contains(&gcode.major_number()))
///     .filter_map(|gcode| gcode.value_for('X'))
///     .collect();
///
/// assert_eq!(got, x_values_should_be);
/// ```
Change the value of a particular gcode's argument.
Change the value of a particular gcode ' s argument .
fn map_argument<S, A, F>(
        self,
        which_gcode: S,
        which_arg: A,
        map: F,
    ) -> MapArg<Self, S, A, F>
    where
        Self: Sized,
        S: Predicate<Gcode>,
        A: Predicate<Argument>,
        F: FnMut(f32) -> f32,
    {
        MapArg {
            iter: self,
            gcode_selector: which_gcode,
            arg_selector: which_arg,
            map,
        }
    }
fn map_argument < S , A , F > ( self , which_gcode : S , which_arg : A , map : F , ) -> MapArg < Self , S , A , F > where Self : Sized , S : Predicate < Gcode > , A : Predicate < Argument > , F : FnMut ( f32 ) -> f32 , { MapArg { iter : self , gcode_selector : which_gcode , arg_selector : which_arg , map , } }
Change the value of a particular gcode's argument.
Change the value of a particular gcode ' s argument .
self
which_gcode
S
which_arg
A
map
F
self
which_gcode
S
which_arg
A
map
F
examples
To apply a translation in the `X` direction to a selection of move
commands  you can do the following.

```rust
use gcode::GcodeTransforms.







let got: Vec = translated
.filter(|gcode| [0, 1, 2, 3].contains(&gcode.major_number()))
.filter_map(|gcode| gcode.value_for('X'))
.collect().

assert_eq!(got, x_values_should_be);
```
To apply a translation in the ` X ` direction to a selection of move commands you can do the following . ` ` ` rust use gcode :: GcodeTransforms . let got : Vec = translated . filter ( |gcode| [ 0 1 2 3 ] . contains ( &gcode . major_number () )) . filter_map ( |gcode| gcode . value_for ( ' X ' )) . collect () . assert_eq! ( got x_values_should_be ) ; ` ` `