Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Rename glib_boxed_get_type! to glib_boxed_type! for consistency #400

Merged
merged 1 commit into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/subclass/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ pub trait BoxedType: Clone + Sized + 'static {

/// Returns the type ID.
///
/// This is usually defined via the [`glib_boxed_get_type!`] macro.
/// This is usually defined via the [`glib_boxed_type!`] macro.
///
/// [`glib_boxed_get_type!`]: ../../macro.glib_boxed_get_type.html
/// [`glib_boxed_type!`]: ../../macro.glib_boxed_type.html
fn get_type() -> ::Type;
}

/// Register a boxed `glib::Type` ID for `T`.
///
/// This must be called only once and will panic on a second call.
///
/// See [`glib_boxed_get_type!`] for defining a function that ensures that
/// See [`glib_boxed_type!`] for defining a function that ensures that
/// this is only called once and returns the type id.
///
/// [`glib_boxed_get_type!`]: ../../macro.glib_boxed_get_type.html
/// [`glib_boxed_type!`]: ../../macro.glib_boxed_type.html
pub fn register_boxed_type<T: BoxedType>() -> ::Type {
unsafe {
use std::ffi::CString;
Expand Down Expand Up @@ -79,7 +79,7 @@ unsafe extern "C" fn boxed_free<T: BoxedType>(v: ffi::gpointer) {
/// the first time it is called.
///
/// [`register_boxed_type`]: subclass/boxed/fn.register_boxed_type.html
macro_rules! glib_boxed_get_type {
macro_rules! glib_boxed_type {
() => {
fn get_type() -> $crate::Type {
static mut TYPE_: $crate::Type = $crate::Type::Invalid;
Expand Down Expand Up @@ -212,7 +212,7 @@ mod test {
impl BoxedType for MyBoxed {
const NAME: &'static str = "MyBoxed";

glib_boxed_get_type!();
glib_boxed_type!();
}

glib_boxed_derive_traits!(MyBoxed);
Expand Down
2 changes: 1 addition & 1 deletion src/subclass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
//! // This macro defines a
//! // fn get_type() -> glib::Type
//! // function
//! glib_boxed_get_type!();
//! glib_boxed_type!();
//! }
//!
//! // This macro derives some traits on the struct
Expand Down