Skip to content

Commit 0221897

Browse files
committed
(undo) Workaround for pending get_ decision
1 parent 9ead1f6 commit 0221897

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

godot-core/src/engine/file.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,3 +709,38 @@ impl std::fmt::Display for NotUniqueError {
709709
)
710710
}
711711
}
712+
713+
// ----------------------------------------------------------------------------------------------------------------------------------------------
714+
// FIXME REMOVE EVERYTHING BELOW
715+
// Temporary workaround for get_ accessors, until it's clear what happens with them
716+
#[cfg(before_api = "4.1.0")]
717+
compile_error!("must not pass CI");
718+
719+
trait FileExt {
720+
fn get_path(&self) -> GString;
721+
fn get_path_absolute(&self) -> GString;
722+
fn get_position(&self) -> u64;
723+
fn get_length(&self) -> u64;
724+
}
725+
trait RefExt {
726+
fn get_reference_count(&self) -> i32;
727+
}
728+
impl FileExt for Gd<FileAccess> {
729+
fn get_path(&self) -> GString {
730+
self.path()
731+
}
732+
fn get_path_absolute(&self) -> GString {
733+
self.path_absolute()
734+
}
735+
fn get_position(&self) -> u64 {
736+
self.position()
737+
}
738+
fn get_length(&self) -> u64 {
739+
self.length()
740+
}
741+
}
742+
impl RefExt for Gd<RefCounted> {
743+
fn get_reference_count(&self) -> i32 {
744+
self.reference_count()
745+
}
746+
}

0 commit comments

Comments
 (0)