pub fn altered_step(self, key: Option<Key>) -> (Step, Option<Accidental>) {
        let key = key.unwrap_or_default();
        let step = self.step();
        if step.with_key(key) == self {
            (step, None)
        } else {
            (step, Some(self.accidental()))
        }
    }
/// Find the appropriate accidental for the Tpc in a key.
///
/// If no key is given, default to C major with no fixed accidentals
///
/// # Example
///
/// ```
/// # use tonality::{Accidental, Key, Step, Tpc};
/// let tpc = Tpc::C;
/// let key: Option<Key> = None;
/// assert_eq!((Step::C, None), tpc.altered_step(key));
///
/// let key: Option<Key> = Some(Key::A);
/// assert_eq!((Step::C, Some(Accidental::Natural)), tpc.altered_step(key));
///
/// let tpc = Tpc::Fss;
/// let key: Option<Key> = None;
/// assert_eq!((Step::F, Some(Accidental::DblSharp)), tpc.altered_step(key));
/// ```
Find the appropriate accidental for the Tpc in a key.
If no key is given, default to C major with no fixed accidentals
Find the appropriate accidental for the Tpc in a key . If no key is given default to C major with no fixed accidentals
pub fn altered_step(self, key: Option<Key>) -> (Step, Option<Accidental>) {
        let key = key.unwrap_or_default();
        let step = self.step();
        if step.with_key(key) == self {
            (step, None)
        } else {
            (step, Some(self.accidental()))
        }
    }
pub fn altered_step ( self , key : Option < Key > ) -> ( Step , Option < Accidental > ) { let key = key . unwrap_or_default ( ) ; let step = self . step ( ) ; if step . with_key ( key ) == self { ( step , None ) } else { ( step , Some ( self . accidental ( ) ) ) } }
Find the appropriate accidental for the Tpc in a key.
Find the appropriate accidental for the Tpc in a key .
self
key
Option<Key>
self
key
Option<Key>
example
None
use tonality::{accidental, key, step, tpc};
let tpc = Tpc::C;
let key: Option = None;
assert_eq!((Step::C, None), tpc.altered_step(key)).

let key: Option = Some(Key::A);
assert_eq!((Step::C, Some(Accidental::Natural)), tpc.altered_step(key)).

let tpc = Tpc::Fss;
let key: Option = None;
assert_eq!((Step::F, Some(Accidental::DblSharp)), tpc.altered_step(key));
```
let tpc = Tpc :: C ; let key : Option = None ; assert_eq! (( Step :: C None ) tpc . altered_step ( key )) . let key : Option = Some ( Key :: A ) ; assert_eq! (( Step :: C Some ( Accidental :: Natural )) tpc . altered_step ( key )) . let tpc = Tpc :: Fss ; let key : Option = None ; assert_eq! (( Step :: F Some ( Accidental :: DblSharp )) tpc . altered_step ( key )) ; ` ` `