-
Notifications
You must be signed in to change notification settings - Fork 53
Change rbx_reflection_database to support loading from FS #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Dekkonot
wants to merge
23
commits into
rojo-rbx:master
Choose a base branch
from
Dekkonot:dynamic-reflection-pog
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7145f07
Add local support to rbx_reflection_database
Dekkonot a4409b7
Add some logging
Dekkonot c5bfda2
Update changelog
Dekkonot ca2cbf0
Update README and module documentation
Dekkonot f8c833f
remove easily
Dekkonot 69d6a70
Specify that env var points to file, not dir
Dekkonot 6bd1b0b
Correctly refer to environment variables as such
Dekkonot f61eab3
Update crate documentation to reflect 69d6a70
Dekkonot d066132
Make `get_local` and `get` use Result
Dekkonot a9f3beb
Update usage of `get` in other crates
Dekkonot 2413092
Correctly handle local path not existing
Dekkonot 99171cb
Merge branch 'master' into dynamic-reflection-pog
Dekkonot d1eeac4
Merge branch 'master' into dynamic-reflection-pog
Dekkonot e5f8c05
Add PR number and link to changelog
Dekkonot 17128fe
Fix database tests
Dekkonot d95bc80
Undo formatting I did on accident
Dekkonot d525f03
Use LazyStatic + drop lazy_static as dependency
Dekkonot 7d639f3
Add test to confirm that the location returned by `get_local_location…
Dekkonot a1d2d37
Allow the `unnecessary_operation` clippy lint
Dekkonot 230c4ae
Handle env vars better
Dekkonot ec8a046
...Disable the clippy lint correctly?
Dekkonot 7328ded
Accept defeat, make a function that does what we're testing
Dekkonot bc78a6f
Merge branch 'master' into dynamic-reflection-pog
Dekkonot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::{fmt, io}; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct Error(String); | ||
|
||
impl std::error::Error for Error {} | ||
|
||
impl fmt::Display for Error { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
write!(f, "{}", self.0) | ||
} | ||
} | ||
|
||
impl From<rmp_serde::decode::Error> for Error { | ||
fn from(value: rmp_serde::decode::Error) -> Self { | ||
Self(value.to_string()) | ||
} | ||
} | ||
|
||
impl From<io::Error> for Error { | ||
fn from(value: io::Error) -> Self { | ||
Self(value.to_string()) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure if breaking this interface is the right call. The way I'm thinking about it is: if
get_local
fails, then probably 99% of the time, users of this function will immediately want to callget_bundled
, so why not just have this function do that for them? That way it does the right thing most of the time, and we can avoid breakage.On the other hand, then it's not clear that this function can fail, and removes the ability to e.g. print a warning if the local database is corrupt while using this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sold on breaking this either, but the other option is hiding failures from users. It might be worth taking a middleground and just emitting a message into stderr if the local database exists but is corrupted?
It may also be worth caching it if we do this though, so it doesn't print the message every time.