Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
b2program
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
b2program
Commits
d6906a93
Commit
d6906a93
authored
Jul 7, 2022
by
Cookiebowser
Browse files
Options
Downloads
Patches
Plain Diff
added missing BString implementation
parent
b8e9ecf1
No related branches found
No related tags found
1 merge request
!28
Rust support
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
btypes_primitives/src/main/rust/btypes/src/bstring.rs
+24
-1
24 additions, 1 deletion
btypes_primitives/src/main/rust/btypes/src/bstring.rs
with
24 additions
and
1 deletion
btypes_primitives/src/main/rust/btypes/src/bstring.rs
+
24
−
1
View file @
d6906a93
use
std
::
fmt
::{
Display
,
Formatter
};
use
std
::
fmt
::{
Display
,
Formatter
};
use
crate
::
bobject
::
BObject
;
use
crate
::
bobject
::
BObject
;
use
crate
::
bboolean
::
BBoolean
;
#[derive(Default,
Debug,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord)]
#[derive(Default,
Debug,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord)]
pub
struct
BString
{
pub
struct
BString
{
...
@@ -17,3 +18,25 @@ impl Display for BString {
...
@@ -17,3 +18,25 @@ impl Display for BString {
}
}
impl
BObject
for
BString
{}
impl
BObject
for
BString
{}
impl
BString
{
pub
fn
new
(
init
:
&
str
)
->
BString
{
return
BString
{
val
:
String
::
from
(
init
)
}
}
pub
fn
isString
(
&
self
)
->
BBoolean
{
return
true
;
}
pub
fn
isNotString
(
&
self
)
->
BBoolean
{
return
false
;
}
pub
fn
equal
(
&
self
,
other
:
&
BString
)
->
BBoolean
{
return
self
.eq
(
other
);
}
pub
fn
unequal
(
&
self
,
other
:
&
BString
)
->
BBoolean
{
return
!
self
.eq
(
other
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment