cleanups, add semicolon everywhere
This commit is contained in:
parent
e8f11c08ea
commit
0968605d0b
19 changed files with 192 additions and 87 deletions
|
@ -32,7 +32,7 @@ wrap_functions!(associate BitmapCommand;
|
|||
origin: Origin::new(origin_x, origin_y),
|
||||
compression,
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
/// Move the provided [Bitmap] into a new [BitmapCommand],
|
||||
/// leaving other fields as their default values.
|
||||
|
@ -40,5 +40,5 @@ wrap_functions!(associate BitmapCommand;
|
|||
/// Rust equivalent: `BitmapCommand::from(bitmap)`
|
||||
fn from_bitmap(bitmap: move NonNull<Bitmap>) -> NonNull<BitmapCommand> {
|
||||
heap_move_nonnull(bitmap.into())
|
||||
}
|
||||
};
|
||||
);
|
||||
|
|
|
@ -18,7 +18,6 @@ wrap_fields!(BitVecCommand;
|
|||
);
|
||||
|
||||
wrap_functions!(associate BitVecCommand;
|
||||
|
||||
/// Set pixel data starting at the pixel offset on screen.
|
||||
///
|
||||
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
|
||||
|
@ -43,6 +42,5 @@ wrap_functions!(associate BitVecCommand;
|
|||
operation,
|
||||
compression,
|
||||
})
|
||||
}
|
||||
|
||||
};
|
||||
);
|
||||
|
|
|
@ -15,7 +15,6 @@ wrap_fields!(BrightnessGridCommand;
|
|||
wrap_origin_accessors!(BrightnessGridCommand);
|
||||
|
||||
wrap_functions!(associate BrightnessGridCommand;
|
||||
|
||||
/// Set the brightness of individual tiles in a rectangular area of the display.
|
||||
///
|
||||
/// The passed [BrightnessGrid] gets consumed.
|
||||
|
@ -30,12 +29,11 @@ wrap_functions!(associate BrightnessGridCommand;
|
|||
grid,
|
||||
origin: Origin::new(origin_x, origin_y),
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
/// Moves the provided [BrightnessGrid] into a new [BrightnessGridCommand],
|
||||
/// leaving other fields as their default values.
|
||||
fn from_grid(grid: move NonNull<BrightnessGrid>) -> NonNull<BrightnessGridCommand> {
|
||||
heap_move_nonnull(grid.into())
|
||||
}
|
||||
|
||||
};
|
||||
);
|
||||
|
|
|
@ -14,7 +14,7 @@ macro_rules! wrap_cc_only {
|
|||
#[doc = " Returns: a new [`" [< $command Command >] "`] instance."]
|
||||
fn new() -> ::core::ptr::NonNull<[< $command Command >]> {
|
||||
heap_move_nonnull([< $command Command >])
|
||||
}
|
||||
};
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -15,7 +15,6 @@ wrap_fields!(CharGridCommand;
|
|||
wrap_origin_accessors!(CharGridCommand);
|
||||
|
||||
wrap_functions!(associate CharGridCommand;
|
||||
|
||||
/// Show UTF-8 encoded text on the screen.
|
||||
///
|
||||
/// The passed [CharGrid] gets consumed.
|
||||
|
@ -30,12 +29,11 @@ wrap_functions!(associate CharGridCommand;
|
|||
grid,
|
||||
origin: Origin::new(origin_x, origin_y),
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
/// Moves the provided [CharGrid] into a new [CharGridCommand],
|
||||
/// leaving other fields as their default values.
|
||||
fn from_grid(grid: move NonNull<CharGrid>) -> NonNull<CharGridCommand> {
|
||||
heap_move_nonnull(grid.into())
|
||||
}
|
||||
|
||||
};
|
||||
);
|
||||
|
|
|
@ -15,7 +15,6 @@ wrap_fields!(Cp437GridCommand;
|
|||
wrap_origin_accessors!(Cp437GridCommand);
|
||||
|
||||
wrap_functions!(associate Cp437GridCommand;
|
||||
|
||||
/// Show text on the screen.
|
||||
///
|
||||
/// The text is sent in the form of a 2D grid of [CP-437] encoded characters.
|
||||
|
@ -30,12 +29,11 @@ wrap_functions!(associate Cp437GridCommand;
|
|||
grid,
|
||||
origin: Origin::new(origin_x, origin_y),
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
/// Moves the provided [Cp437Grid] into a new [Cp437GridCommand],
|
||||
/// leaving other fields as their default values.
|
||||
fn from_grid(grid: move NonNull<Cp437Grid>) -> NonNull<Cp437GridCommand> {
|
||||
heap_move_nonnull(grid.into())
|
||||
}
|
||||
|
||||
};
|
||||
);
|
||||
|
|
|
@ -248,7 +248,7 @@ wrap_functions!(associate GenericCommand;
|
|||
data: CommandUnion { null: null_mut() },
|
||||
});
|
||||
heap_move_nonnull(result)
|
||||
}
|
||||
};
|
||||
);
|
||||
|
||||
wrap_methods! { GenericCommand;
|
||||
|
|
|
@ -7,14 +7,12 @@ use servicepoint::{Brightness, GlobalBrightnessCommand};
|
|||
use std::ptr::NonNull;
|
||||
|
||||
wrap_functions!(associate GlobalBrightnessCommand;
|
||||
|
||||
/// Set the brightness of all tiles to the same value.
|
||||
///
|
||||
/// Returns: a new [GlobalBrightnessCommand] instance.
|
||||
fn new(brightness: val Brightness) -> NonNull<GlobalBrightnessCommand> {
|
||||
heap_move_nonnull(GlobalBrightnessCommand::from(brightness))
|
||||
}
|
||||
|
||||
};
|
||||
);
|
||||
|
||||
wrap_command!(GlobalBrightness);
|
||||
|
|
|
@ -64,7 +64,7 @@ macro_rules! derive_command_into_packet {
|
|||
/// Returns: NULL or a [Packet] containing the command.
|
||||
fn try_into_packet(move instance) -> *mut ::servicepoint::Packet {
|
||||
$crate::mem::heap_move_ok(instance.try_into())
|
||||
}
|
||||
};
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue