Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Nov 1, 2024
1 parent 7b2ba2e commit 48188c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions crates/dojo/bindgen/src/plugins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ impl Buffer {
/// * `pos` - The string inside inner vec to search position for.
/// * `sep` - The separator to search for.
/// * `idx` - The index of the separator to insert after.
///
pub fn insert_after(&mut self, s: String, pos: &str, sep: &str, idx: usize) {
let pos = self.pos(pos).unwrap();
if let Some(st) = self.0.get_mut(pos) {
Expand All @@ -69,7 +68,6 @@ impl Buffer {
/// * `s` - The string to insert.
/// * `pos` - The position to insert the string at.
/// * `idx` - The index of the string to insert at.
///
pub fn insert_at(&mut self, s: String, pos: usize, idx: usize) {
if let Some(st) = self.0.get_mut(idx) {
st.insert_str(pos + 1, &s);
Expand All @@ -79,7 +77,6 @@ impl Buffer {
/// Finds position of the given string in the inner vec.
///
/// * `pos` - The string to search for.
///
pub fn pos(&self, pos: &str) -> Option<usize> {
self.0.iter().position(|b| b.contains(pos))
}
Expand All @@ -93,7 +90,6 @@ impl Buffer {
/// * `needle` - The string to search for.
/// * `search` - The string to search after.
/// * `idx` - The index to search at.
///
pub fn get_first_after(&self, needle: &str, search: &str, idx: usize) -> Option<usize> {
if let Some(st) = self.0.get(idx) {
let indices = st.match_indices(needle).map(|(i, _)| i).collect::<Vec<usize>>();
Expand All @@ -114,7 +110,6 @@ impl Buffer {
/// * `search` - The token to search for.
/// * `pos` - Starting position of the search.
/// * `idx` - The index to search at.
///
pub fn get_first_before_pos(&self, search: &str, pos: usize, idx: usize) -> Option<usize> {
if let Some(st) = self.0.get(idx) {
let indices = st.match_indices(search).map(|(i, _)| i).collect::<Vec<usize>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ mod tests {
fn test_generate_system_function() {
let generator = TsFunctionGenerator {};
let function = create_change_theme_function();
let expected = "\tconst actions_changeTheme = async (account: Account, value: number) => {
let expected = "\tconst actions_changeTheme = async (account: Account, value: number) => \
{
\t\ttry {
\t\t\treturn await provider.execute(
\t\t\t\taccount,
Expand Down

0 comments on commit 48188c1

Please sign in to comment.