Card's methods take values, not references

I expect that we will not want to retain the original copy of a Card
after merging, cutting, rotating, etc. This function signature says that
the value moves into the method and goes away. If this becomes an
annoyance, then we change it.
This commit is contained in:
2025-08-23 09:38:49 -05:00
parent daf05e3609
commit 4a17666bba

View File

@@ -115,19 +115,19 @@ impl Card {
}
/// Cuts this Card on the given line. Returns two cards
pub fn cut(&self, line: CutLine) -> (Self, Self) {
pub fn cut(self, line: CutLine) -> (Self, Self) {
todo!();
}
pub fn flip(&self, flip: FlipDir) -> (Self) {
pub fn flip(self, flip: FlipDir) -> Self {
todo!();
}
pub fn transpose(&self, other: &Self, selection: TransposeSelection) -> (Self, Self) {
pub fn transpose(self, other: Self, selection: TransposeSelection) -> (Self, Self) {
todo!();
}
pub fn rotate(&self, dir: RotationDir) {
pub fn rotate(self, dir: RotationDir) {
todo!();
}
}